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.
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.
Named Values
Section titled Named ValuesBy 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.
Setting a Named Value
Section titled Setting a Named ValueTo 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.
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."
Using a Named Value
Section titled Using a Named ValueTo use the Named Value in the Condition component, click the Condition component and select the condition we created earlier, as shown below.
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.
When you click the input box, you'll see a list of available Named Values. Currently, there is only one, "Today." Select this option.
Finally, save the Query Form by clicking the Save button.
Conclusion
Section titled ConclusionAs 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!