Skip to content

Working With Data

In the previous article, we used the Condition component to compare the scheduled date of a tweet with the current date, but we still haven't retrieved the current date. In this article, weโ€™ll dive into how Monkedo handles data, exploring data types, and showing you how to create, process, and format data for your automations.

Monkedo components accept and output values in specific data types, which are shown next to the input and output names in the info panel. These data types help streamline how you work with data and include:

  • Text

  • Number

  • Date

  • Time

  • File

  • Yes/No

  • Table

  • List

  • Entity

If youโ€™d like to see examples of these data types in action, feel free to watch our short introductory video:

Monkedo offers a wide array of components to work with data. These are categorized under the Action section of the component selector, as shown below.

components for data types

Each type category (Text, Date, Math, etc.) contains specific components to handle various operations. For instance:

  • Text components can split, concatenate, change the case, or extract values from text.

  • Math components perform calculations and format numbers.

We recommend exploring these categories to familiarize yourself with their functions. Whenever you need to manipulate data, check the relevant category to find the necessary components.

For now, letโ€™s focus on what we need for our automation: retrieving the current date to compare it with the date from our tweet schedule.

Monkedoโ€™s Date & Time category includes components like Add/Subtract Time, Create Date, and Date Difference. For our automation, weโ€™ll use the Get Current Date component to fetch the current date when the automation runs. This simple component doesn't require any input and returns the current date as its output.

get current date
Get Current Date component

Running the component will display the current date in your local timezone, as shown below.

get current date result

Another way to get the current date is to use the output of the trigger component of our automation. Remember that the Schedule Trigger component outputs the date at which automation is triggered. This way we do not need to add a new component to get the date. However, if our automation used a different trigger component, we would need to rely on the Get Current Date component to retrieve the current date.

Date values in Monkedo are precise up to the millisecond, which means that for two dates to be considered equal, they must match exactly, including the time. In our case, the dates in the tweet schedule only contain the year, month, and day, while the Get Current Date component includes hours, minutes, and more.

Therefore, we canโ€™t directly compare these dates. Instead, we need to extract only the year, month, and day from the current date before comparing it to the scheduled tweet date.

One key detail to note is that the Date column in the tweet schedule table appears as Text in the editor. This can be seen both in the result of the Get Values component and in the Query Form when selecting the column.

type of date in expanded table
Output of the Get Values component
type of date field in query form
Columns of the row as shown in the Query Form

This happens because the dates we enter in the spreadsheet are not actual Date values but rather text-based representations of dates. Actual date values are created by computers, humans can only enter them as text representations. Some apps may automatically convert these text entries into proper Date values, but in cases like Google Sheets, you'll receive them as plain text. To compare these values, youโ€™ll need to convert them from text to Date format, and vice versa. Fortunately, Monkedo provides various components to handle these conversions, so youโ€™re well-equipped for the task.

Our goal is to check whether the tweet date matches the current date, ignoring the time. To do this, we can use the Format Date component to convert the current date to a format like "9/27/2024," which matches the format used in our tweet schedule. The component is shown below.

format date component
Format Date component

The first input is the date we want to format and we will provide it from the output of the Schedule Trigger. Select this component and place it near the Schedule Trigger. Then, connect the Schedule Trigger to this input. Your automation diagram should look like this:

automation with format date

Now, let's continue to set other inputs of this component in the info panel as shown above:

  • Type: Select "Only Date" since we only need the year, month, and day.

  • Date Format: The format we used in our tweet table is "6/24/2024". This is Month/Day/Year format. Select this option.

  • Timezone: Select your local timezone.

The final values of the inputs should look like this:

format date inputs

Running the component will convert the current date to the desired text format, as shown below:

formatted date

What is Next?

In this article, we mentioned data types in Monkedo and used the Get Current Date and Format Date components to retrieve and format the current date. In the next article, weโ€™ll use this formatted date in the Condition component to determine if a tweet is scheduled for today.

Stay tuned for the next step in building your automation!