Skip to content

Expressions

We’ve now reached a point where we can retrieve the tweet content and verify if it’s scheduled for today. Finally, it’s time to send the tweet!

To get started, click on the Action category in the component panel and search for "tweet." You’ll see the Create a Tweet component. Select it and place it next to the Condition component, as shown below. This component has three key inputs:

  1. Twitter Connection: Click this button to connect your Twitter (X) account.

  2. Text: This will be the content of your tweet.

  3. Place ID: This is optional and allows you to attach a location to your tweet.

Ekran Resmi 2024-10-10 17.02.12

Before we integrate this into the full automation, let’s test the Create a Tweet component on its own to ensure it works as expected. After connecting your account, you can enter the tweet text manually. By default, the Text input expects its value from another component, but for testing purposes, we’ll enter the content directly. To do this, toggle the switch (as shown by the arrow in the image) to reveal the input box.

Copy and paste the following example text into the input box, including the emoji:

My first tweet with monkedo.com 🚀

Run the component, and you should see this tweet appear on your profile, just like this:

My first tweet with monkedo.com

Now that we’ve confirmed the tweet component works as expected, let’s set the tweet content dynamically from the automation flow instead of using a constant value. The Iterate Table component will provide each row of the schedule, and the Condition component will check if the tweet is scheduled for today. If it is, the Condition component will send that row through its "Today" output. Remember, the Condition component simply forwards the input without changing it.

We’ll connect the Today output to the Text input of the Create a Tweet component, as shown below. To do this, click the switch on the Text input in the info panel to hide the manual input box and create a connection point on the component.

Ekran Resmi 2024-10-10 17.09.59

The entire automation diagram should look like this:

Tweet schedule automation diagram

Before testing, ensure one of the rows in your table has today’s date. After updating the table, don’t forget to run the Get Values component to fetch the latest table data. Then, run the Iterate Table component enough times to reach the correct row. Once that row is passed through the Condition component, the Today output will activate.

Ekran Resmi 2024-10-10 17.16.08

At this point, if you run the Create a Tweet component, you may encounter an error like this:

Ekran Resmi 2024-10-10 17.17.47

This error occurs because the Text input expects a plain text value, but the output from the Condition component is an entire row of data, not just the tweet content. To resolve this, you need to select the Content field from the row data to use as the tweet’s text.

When working with tables or data returned from apps, you'll often encounter data packaged into blocks like lists, entities, or tables.

Here is an example for List which contains words.

List value example

Here is an example for Entity which contains a record with multiple fields.

Example entity

Finally, here is an example for Table which contains user information.

Example table value

It's common to need access to a specific field within these blocks rather than the entire data set. In such cases, Expressions allow you to select individual items, fields, or cells. For example, you can select an item from a list, a field from an entity, or a cell from a table.

In our automation, we need to extract the Content field from the tweet schedule row and pass it to the Text input of the Create a Tweet component. When you hover over an input, you'll see the "+Expression" option, as shown below.

Expression button

Clicking it opens the Expression Box, where you can select a field from the input value. If there is a previous input already present, be sure to delete it before proceeding.

Expression box showing tweet schedule table row fields

The options menu will display all the available fields from the input, as well as any named values. This is how you can select specific fields or named values to use in component inputs. Once you select the Content field, it will be passed to the Create a Tweet component, and you'll see the expression appear in the box, as shown below.

Expression box example

Now, when you run the Create a Tweet component, the tweet will be posted to your profile as expected.

Ekran Resmi 2024-10-10 17.50.44

Expressions not only allow you to access specific fields from data but also let you process the data before passing it to an input. At the top of the Expression Box, you will see a blue-colored link as shown by the arrow below. Clicking this will open a menu so that you can choose from different expression types.

Expression Types
Expression Types

Here’s a quick overview:

  • Text: Use this to concatenate text values. For example, you can create messages like:
    "Hello [client name], your order of $[cost] will arrive on [date]."
    By selecting values from the options menu, Monkedo will automatically insert the selected data into the text.

  • Math: Perform calculations on numeric values. For instance, you can compute a total cost by using:
    [unit cost] * [quantity] + 10
    Select the values in brackets from the options menu to automatically calculate and insert the correct values.

  • Access: This allows you to retrieve a sub-field from a block of data. For example, you can select a specific cell from a table by specifying the desired row and column.

In Text and Math expressions, you can combine multiple values from the options menu to merge different data points for a single input.

What is Next?

Congratulations! We've completed the automation, exploring many of Monkedo's powerful features along the way. With these examples, you're now equipped to create a wide range of automations on your own. In the next article, we'll cover how to deploy this automation so it runs automatically without manual intervention.