Data tables store information that you can use across all the different workflows in your AUTTO account. When used together with Actions, they allow you to dynamically create, update, lookup, and delete data within a table as part of your workflows.
To ensure clearer understanding of data table concepts, this article takes the form of a short tutorial on creating a data table, then using it, together with a couple of data table-related Actions, in a workflow. You will then run the workflow on the User Application.
Table of Contents
- What are Data Tables?
- Creating a Data Table
- Using Data Tables in a Workflow
- Running the Workflow
To fully understand this article, we recommended reading the following articles first:
The following articles may also be useful when going through the tutorial in this article.
What are Data Tables?
Data tables are a key feature of AUTTO that allows data management capabilities to be integrated in your workflows. Aside from their use as reference tables in your workflows, they also allow workflows to be updated by information created in other workflows. For more information, see Using Data Tables.
For our tutorial, we will create a single Employee data table. We will then look for an employee record in the table and display the results in a page. If there is an existing employee record, we will display it and then present a form where the user can update the record. An update to the employee record also updates the corresponding row in the Employee data table.
If there is no employee record, the user will see a form that they can use to insert the record into the Employee data table.
Creating a Data Table
For this tutorial, we will create an Employee data table with the following columns and column types:
|First Name||Text||First name|
|Last Name||Text||Last name|
|Email (UID)||Email address|
Set the Email column as a Unique ID (UID), which means that it will not accept duplicate email addresses and, more importantly, allow its use for looking up information from and updating the Employee table. For more information on the various column types you can use in data tables, see Table Column Types.
To create our data table, follow the procedures in Creating a New Data Table.
This is how the table columns will look like after creating the table.
Using Data Tables in a Workflow
Let's now create our workflow.
- Create a new workflow (for more information, see Creating a New Workflow).
- Add a Form action where the user can ask for the employee's email address.
- Add a LookUp action using the Employee table as the lookup input table. For more information, see LookUp Action.
- Set the conditions for filtering the data table to a single row.
- Under the Outputs section, choose the columns from the lookup table that you will use later on in the workflow and give them corresponding square bracket names.
NOTE: Instead of a LookUp action, you can add a Lookup question to the Form action we added in Step 2 above. For more information, see Lookup Questions.
- Add a Page action where you can display the output of the Lookup action you added in Step 3. For more information, see Page Action.
- Add a Condition action that will take you down two paths, depending on the results of the lookup action. If there is an existing employee record, you will go down one path where you can update the existing record in the Employee table. If the lookup does not find anything, you will go down another path where you can add a new record to the Employee table. For more information, see Condition Action.
- Add two Form actions, one for each path in the Condition action you added in Step 7. For more information, see Form Action.
This is how the Add New Record form should look like.
The image below shows the Update Existing Record form.
- Add an Update Data Table action for adding a new record to the Employee data table. For more information, see Update Data Table Action.
- Add another Update Data Table action for updating an existing record in the Employee data table.
- Add separate Page actions down each path where you can inform the user that the Employee data table has been updated.
Running the Workflow
After creating the workflow, you can then publish and run it. Check that the data table is updated when adding a new or editing an existing record.
When run in the User Application, the workflow we added in Using Data Tables in a Workflow should look like the following:
Article is closed for comments.