The Run for Table feature allows you to run an action against every record in an existing table and enter the results into a new table. This article discusses the Run for Table feature in more detail.
Table of Contents
- What is Run for Table?
- What Actions have a Run for Table feature?
- Setting Up Run for Table in an Action
- Creating a Run for Table-Enabled Workflow
- How Run for Table Works
What is Run for Table?
The Run for Table feature allows you to run an Action in a workflow against every record in an existing table (the Input table) and enter the results into a new table (the Output table). Using square brackets, you can then use the new table later on in the workflow. For more information, see Working with Square Brackets.
The Run for Table feature works with both persistent data tables created under the Main Menu and temporary tables created earlier in a workflow.
For example, using a Currency Rates table as the Input table and a Rate Change table as the Output table, you can use a Calculator action to derive the changes in the current values of certain currencies from their values yesterday. Since your Action has Run for Tabled enabled, it is applied to all the currencies in the Currency Rates table. After calculating the changes, your Action saves the results into the Rate Change table, which you can then call from anywhere in your workflow using its square bracket name.
NOTE: Output tables can be formatted to suit your requirements. For more information, see Table Square Brackets.
What Actions have a Run for Table Option?
The Run for Table option is available in the following Actions:
- Calculator Action
- Conditional [] Action
- LookUp Action
- Update Data Table Action
- Get Data Action
- Send Data Action
- Start Bot Workflow Action
Click the corresponding Action above to know more about how each is set up.
Setting Up Run for Table in an Action
To set the Run for Table option:
- The Run for table button is displayed on the top left of the Action Editor. Click the button to enable the option.
- Once the option is enabled, the Input and Output Table boxes are displayed. Select the input table's square bracket name from the list.
NOTE: You will know the types of tables you can work with based on their names - data tables are marked with an exclamation point, !, at the beginning while temporary tables are shown without this mark. For more information, see Getting Started with Data Tables. - Enter the square bracket name you want to give to the output table, which will store the result of the Action. Using its square bracket name, the output table can be used later on in the workflow. For more information, see Table Square Brackets.
- Set up the rest of the Action.
When enabled, the Run for Table option runs the Action against every record in the input table, then generates an output table containing the result/s of the Action. The output data is stored in square bracket/s, which can be used later on as the workflow progresses.
Data in output tables can be reformatted to suit your requirements. For more information, see Table Square Brackets.
Creating a Run for Table-Enabled Workflow
To see how Run for Table works, let's check out a sample workflow that will calculate the sum of two numbers under two different columns in the input table, then adds the sum in a new column under the output table.
- Create a workflow. For more information, see Creating a Workflow.
- Add a Form action to the workflow, connect the Start action to it, open the Action Editor, then add a Table question to the Form action. Take note of the square bracket name for this Table question, since you will use it in Steps 4 and 5. For more information, see Form Action.
- Add two number sub-questions to the Table question. Make the sub-questions compulsory. For more information, see Table Questions. Take note of the square bracket names for the Number sub-questions, since you will use them in Steps 4 and 5.
- To see how the Table will look like, add a Page action to the workflow next, then under the Page text section, format the Table and number square brackets from Steps 2 and 3. For more information, see Table Square Brackets.
- Add a Calculator action to the workflow, then turn on its Run for Table feature, select the Table square bracket from Step 2, and enter a square bracket name for the Output table. Take note of the square bracket name for the Output table since you will use it in Step 7.
- Under the Formula section, add the two number sub-questions from the Table question in Step 3, and enter a square bracket name for the result. Take note of the square bracket name for the result since you may need it in Step 7.
NOTE: To know more about setting up the Calculator action in Steps 5 and 6, see Calculator Action.
- Add another Page action to the workflow, then under the Page text section, select the table square bracket from Step 5, then format the table accordingly. Make sure that it will show the result of the Addition calculation performed in Step 5. For more information, see Formatting a Table Square Bracket.
- Preview, then publish the workflow.
How Run for Table Works
When run, the above workflow will ask you to enter two numbers that are then added to a table of records.
You can then view how these records appear on the next page.
Finally, you can view the output table, with the sum of the two numbers appearing in another column.
Comments
0 comments
Article is closed for comments.