Adding an Inline Expression to an Action Input Field
Use Node.js code and a combination of the output of any previous actions in the workflow to create an inline expression. Any input field that has the
![](../../../ThingWorx/images/ConsoleIcon.jpg)
icon supports inline expressions. To add an inline expression to the input field of any action, complete the following steps:
1. In the input field, click
![](../../../ThingWorx/images/ConsoleIcon.jpg)
to open the code editor.
2. Type Node.js code in the code editor. You must specify a return statement to return a value for the inline expression.
The code editor displays
![](../../../ThingWorx/images/ErrorIcon_2.png)
next to line that has an error. Hover over
![](../../../ThingWorx/images/ErrorIcon_2.png)
to display the error.
The code editor displays
![](../../../ThingWorx/images/InfoIcon_2.png)
next to line that has an informational message. Hover over
![](../../../ThingWorx/images/InfoIcon_2.png)
to display the message.
3. Click
![](../../../ThingWorx/images/ExpandCollapse.png)
if you want to use the output of any previous action. For example, you can assign the value of the output of any action to a variable.
4. Click SAVE to save the inline expression.
The inline expression appears as
![](../../../ThingWorx/images/InlineExpression.png)
in the action input field.
5. Additionally, you can perform the following tasks:
◦ To view or edit the inline expression, click
![](../../../ThingWorx/images/ConsoleIcon.jpg)
.
◦ To remove the inline expression from the input field, click
![](../../../ThingWorx/images/RemoveInlineExpressionIcon.png)
in the input field.