Skip to content

Named Values

In the previous article, we converted the current date into the same text format used in the tweet schedule table. Earlier, we set up the Condition component, but we used a fixed date for comparison. Now, we can replace that fixed value with the actual current date.

Let’s take a closer look at the inputs of the Condition component, as shown below. The Input field takes the current row from the Iterate Table component, and the Conditions input is configured in the info panel.

no extra input on condition component

But there's no free port to connect the formatted date. So, how do we connect the output from the Format Date component for comparison? This is a common scenario in automations where you need to use the outputs of multiple components in a single input. However, you can't directly connect multiple component outputs to the same input. Instead, you can assign names to those outputs and access their values by referencing their names.

By default, component outputs in Monkedo are nameless and can only be used by directly connecting output ports to input ports. However, Named Values allow you to assign names to specific outputs, making it easier to access them throughout your automation without needing to create direct connections between ports in the editor.

You can find components for managing Named Values under the Data Action category in the components panel, as shown below. These components let you set, retrieve, and delete Named Values.

Named Value components
Named Value components

To name the output of the Format Date component, we'll use the Set Named Value component. Add it to your editor. This component has two inputs: the name of the value and the value itself. As shown below, you can choose any name you'd like. In this example, we name the value "Today," and connect the value input to the output of the Format Date component.

Set Named Value component
Set Named Value component

After adding the component, run it to set the Named Value. Now, you can refer to this value anywhere in your automation by using its name, "Today."

To use the Named Value in the Condition component, click the Condition component and select the condition we created earlier, as shown below.

Conditions of the condition component in first automation

This opens the Query Form. Previously, we set the right side of the rule to a constant text value. Now, we'll use the Named Value we just created. Click the selector button next to the rule and choose the Expression option, as shown below.

Ekran Resmi 2024-10-08 17.47.09

When you click the input box, you'll see a list of available Named Values. Currently, there is only one, "Today." Select this option.

Ekran Resmi 2024-10-08 17.49.28

Finally, save the Query Form by clicking the Save button.

Ekran Resmi 2024-10-09 16.51.54

As shown, it’s simple to assign names to component outputs and use them throughout your automation. In this example, we used the Named Value in the Condition component’s query form, but Named Values can be used as inputs in any component. You can also combine multiple Named Values in a single input for greater flexibility.

What is Next?

In this article, we covered Named Values and how to use them in the Condition component. Next, we’ll dive into an important topic: the order in which components run and how it impacts your automation.

See you in the next article!