Use Case: Save Values After Iterating on a Table
In this use case, an organization must save values from a table. Explore how the define web table action, data stitch action, and a foreach loop support this workflow.
Scenario
A robot completes the following tasks:
-
Opens a dashboard, and views all invoices that have been placed on hold.
-
Collects the following information for all on-hold invoices:
-
Invoice number
-
Hold reason
-
Invoice amount
-
Why Create a Robot?
An API is unable to capture the data from the table, or the team that is planning this automation work is unaware of the availability of an API that can do this work.
Workflow
Requirement | How to meet the requirement |
---|---|
Create a data type for the trigger's output |
See Create a Data Type. |
Define the trigger's output |
The output allows the robot to collect the invoice number, hold reason, and invoice amount for each on-hold invoice and pass this information back to the integration. |
Define the variables |
Define a variable to hold each invoice number, hold reason, and invoice amount
Because this variable is of the
These properties hold the required data from the on-hold invoices. This variable collects the values obtained by the get text action. This variable also sends the values to the output using a data stitch action. See Create a Variable. |
Identify the columns that contain the data that you need |
Add a define web table action, and target the columns that contain the data that you need. After you finish identifying the columns, the action looks similar to this: |
Add a foreach loop so that you can iterate over the XPath locators in the table |
Add a foreach loop to the robot. With the define web table action, you identify the XPath locators that you're interested in. The foreach loop allows you to iterate over these locators.
See Add a Foreach Loop. |
Get text from the table |
Overview Within the foreach loop, add the following actions:
The first iteration of the foreach loop gets text from the first row in the table. The second iteration gets text from the second row in the table, and so on. How to define the get text actions
How to define the log actions For each log action, in the
Message field, drag the appropriate
property for the
See Add a Get Text Action and Add a Log Action. |
Add a data stitch to the foreach loop, and define its details |
The data stitch doesn't contain an assign operation
because the get text action already inserted values into the
properties of the placeholder variable
(
|