This article discusses the role of square brackets in Actions. Square brackets are used to store information that can be called on later in a Workflow.
To ensure that square brackets are clearly understood, this article takes the form of a tutorial on creating square brackets, then using them in an Action. We will also run the Workflow we created on the User Application.
Table of Contents
- What are Square Brackets?
- Naming a Square Bracket
- Creating a Square Bracket to Store Data
- Using a Square Bracket in an Action
- How Square Brackets Look Like in a Workflow
To fully understand this article, we recommended reading the following articles first:
What are Square Brackets?
Square brackets are used to store information that can be used later in a workflow. The information stored in them may come from a user in a Form Action, be received through a Get Data Action, or be created as part of a workflow. For example, the result of a calculation can be stored in a square bracket.
Square brackets can be used across multiple Actions, allowing users to retrieve the information stored in them. They can also be used to build intelligent conditions into a workflow, allowing the Workflow to progress differently depending on a square bracket input. Current system information such as the time, date, and information about the user is also stored in square brackets.
Naming a Square Bracket
Square brackets follow the format [square_bracket], thus their name.
When creating a square bracket, you have to give it a Name without any spaces within - it is recommended to use the underscore character ( _ ) to separate words in Square Bracket names. For example, employee_name.
The [ ] symbols are not used when naming a Square Bracket. The [ ] symbols are only used when you need to get the information contained within the Square Bracket and display it somewhere in your Workflows.
Creating a Square Bracket to Store Data
In this section, we will create a Form action with two (2) square brackets, namely:
We will then use these square brackets in the workflow.
To create the square brackets:
- Create a Workflow (see Creating a Workflow for more information) and name it Welcome Email.
- After setting up the Start action, add a Form action to the workflow.
- Position your cursor over the Form action, then click Edit.
- On the Action Editor, click the Add button on the top-right and select a Text question type.
- On the Question box, enter Enter employee's name.
- Check the Compulsory question box, then on the Give a name for the answer box, enter employee_name. This is our 1st square bracket.
- Optionally, enter a description and check the Long text question box to display a larger box on the field. You may also the Advanced Options button to display other configuration options for the question.
- Click Done to save your changes.
- Let's now add the 2nd square bracket. On the Action Editor, click Add, then select the Email question type.
- On the Question box, enter Enter employee's email address.
- Check the Compulsory question box, then on the Give a name for the answer box, enter email_address. This will be our 2nd square bracket.
NOTE: Make sure to use a working email address if you want to test the workflow later following the instructions in How Square Brackets Look Like in a Workflow.
- Optionally, enter a description and check the Long text question box to display a larger box on the field. You may also the Advanced Options button to display other configuration options for the field.
- Click Done to save your changes, then click X to save the Form and close the Action Editor.
Do not publish the Workflow yet since we will add need to add another Action to it. This will allow us to demonstrate how to use the square brackets that we created above.
Using Square Brackets in an Action
Once a Square Bracket is created and information is stored in it, you can use it in an Action.
In the example below, we will use the employee_name and employee_email square brackets we created in the previous section to gather information from our users.
To use the square brackets we created above in an Action:
- Add an Email action to the Workflow we created in Creating a Square Bracket to Store Data.
- Connect the Form action to the Email action.
- Click Edit to configure the Email action.
- On the Action Editor, under the To box, enter [email_address].
NOTE: Since you added email_address previously to the Form action that you connected to the Email action, this becomes available for use within the Form action.
In addition, when you start typing the opening bracket, [ , in the To box, if you have other square brackets aside from the ones you created earlier, you should see them appear in a list even before you complete entering the square bracket name. This can be seen in the above screenshot.
- Enter Welcome Email as the email subject.
- Under the Email text box, enter the following text:
Welcome to the company!
- Click Done to save your changes, then click X to save the Action and close the Editor. The screenshot below shows the completed Email action.
NOTE: You can use Square Brackets in fields marked with [ ] to the right. For example, in the above screenshot, square brackets can also be used in the cc, bcc, and Subject fields.
- With our Workflow design completed, we can now publish the workflow. For more information, see To Publish a Workflow.
NOTE: To see how the email will look like, you can also add a Page action to the Workflow before the Email action. For this Page action, you can use the same text used in the Email action. The employee name and email address corresponding to the employee_name and employee_email square brackets will be displayed on this Page action (sort of like an Email Preview) prior to sending the email.
What do Square Brackets look like in a Workflow?
Let's now run the Workflow on the User Application.
- On the Workflow Editor, click Address, then click the URL for the Workflow to open the User Application in a separate browser window.
- On the User Application, you will be asked to enter the employee name and email address (these correspond to the employee_name and employee_email square brackets we created above). Follow the prompts until the Workflow is completed.
- Check your mailbox for the email addressed to the employee you entered in Step 2.