Items Module

The Items module allows you to easily handle items in your robotic process. An item is a unit of data to be processed. Depending on the nature of your robotic process, an item could be a person, an ID, a bank account, an invoice, etc. The type of processing varies as well, but is consistently applied to each item. For example, an item may be an invoice which is processed by extracting the total amount, performing a calculation, and sending the resulting value to Appian.

It's common for a robotic process to iterate over many items, so the process must know how many items need to be processed, and which item is currently being processed from that list. Once the robotic process finishes processing an item, it will indicate whether the item was successfully processed or if it encountered errors or exceptions. This information is communicated through the server to the Results tab of the Execution details page in the Appian RPA console.

2232648.png

The robotic process communicates this information using the methods in the Items module. This page describes Appian RPA's Items module, which provides an easier and more robust development experience.

For more experienced developers, more options are available using the Client Java module. IJidokaStatistics is the corresponding Java module.

Using the Items module

To use the Items module, open the Robotic Processes tab of the Appian RPA Console. Create a new robotic process or open the configuration of an existing robotic process and navigate to the Workflow area of the page.

The Items module contains the methods described below.

Use these methods in the following order in your workflow:

  1. Set number of items
  2. Set next item
  3. Set item result

Set number of items

The Set number of items method tells the server the total number of items that need to be processed. This value must be set in the beginning of your workflow so the process knows exactly when it should stop iterating over the items and move to the next part of the workflow.

To use the Set number of items method:

  1. Click on an action in your workflow and click the list icon 951644.png.
  2. From the Module tree, open the Items module and click Set number of items. The Set number of items pane displays.
  3. In the CONFIGURATION area of the pane, configure the following parameters:
    • In the Number of Items field, you can enter a number, select a robotic process variable from a picker, or write an expression to determine the total number of items.
  4. In the AFTER COMPLETION area of the method pane, configure parameters as described in After completion parameters.
  5. Click OK to save your changes to the action.
  6. Click SAVE CHANGES in the page toolbar.

Set next item

The Set next item method tells the server which item is being processed. Each item requires an item key, which is a unique value representing the item. For example, if you are processing an invoice, the item key would be the invoice number.

When setting this value in the Java code, you need to identify the item key and the item index; however, one of the benefits of this low-code method is that the platform will calculate the item index automatically, so you only need to provide the item key.

To use the Set next item method:

  1. Click on an action in your workflow and click the list icon 951644.png.
  2. From the Module tree, open the Items module and click Set current item. The Set current item pane displays.
  3. In the CONFIGURATION area of the pane, configure the following parameter:
    • In the Item key field, enter the item key, select a robotic process variable from a picker, or write an expression to obtain the item key.
  4. In the AFTER COMPLETION area of the method pane, configure parameters as described in After completion parameters.
  5. Click OK to save your changes to the action.
  6. Click SAVE CHANGES in the page toolbar.

Set item result

The Set item result method tells the server the resulting status of the current item. At the end of the robotic process, each item will have a result status that can be found on the Results tab of the Execution details page.

Items can have one of two resulting statuses:

  • OK: The robotic process successfully processed the item without any errors.
  • WARN: An exception or error occurred while processing the item. Each resulting status can be accompanied by a message that describes the result.

The Set item result method also allows you to extract properties about the item, such as item's description or identifier. Item properties provide more context about the item and allow you to filter item results by sub-types. Item properties are represented by key/value pairs, which can be defined using an expression in the action. For example, your robotic process is processing multiple invoices and one of your invoices is entered incorrectly. The result status could be set to WARN and the item's identifier could be captured as an item property so you know exactly which invoice encountered the error.

To use the Set item result method:

  1. Click on an action in your workflow and click the list icon 951644.png.
  2. In the Module tree, open the Items module and click Set item result. The Set item result pane displays.
  3. In the CONFIGURATION area of the method pane, configure the following parameters:
    • In the Item Result field, select OK or WARN from the dropdown or write an expression that returns the values OK or WARN.
    • In the Result Detail field, specify a message you want to add to the item result.
    • In the Subresult field, specify the color you want to use to categorize the item results.
  4. In the AFTER COMPLETION area of the method pane, configure parameters as described in After completion parameters.
  5. Click OK to save your changes to the action.
  6. Click SAVE CHANGES in the page toolbar.

After completion parameters

For each of the methods in this module, you can configure the following parameters in the AFTER COMPLETION area of the method pane:

  • Wait before executing next action: Enter the number of seconds the robotic process waits before it continues to the next action in the workflow.
  • Take a screenshot: If you select this option, the robotic process takes a screenshot of the resource immediately after the action completes successfully.

Example workflow

The methods in this module work together to communicate processing status to the Appian RPA server. To help show how they work together, consider this example workflow.

rpa-items-workflow.png

In this example, the robotic process opens a browser and navigates to a website where a list of articles appear. The robotic process gets the title of each article and appends it to a variable. These steps repeat until the chosen number of article titles are captured.

To begin, the number of total items to process is set in the Set Number of Items action. It uses the method of the same name. Rather than typing a number in the Number of Items field, it uses an expression to use the robotic process variable (numberOfArticles). You may find it easier to maintain the robotic process by using a variable to set the number of items.

Next, in the Set Item action, the Set next item method uses an expression to set the item key. As each item is processed, this number will iterate until it reaches the total number of items to process. Therefore, it also uses a robotic process variable (index) so it can be updated throughout execution. Index uses 1 as its initial value. In the Increment action later in the workflow, the expression pv!index + 1 updates the variable's value to show that the next item is ready to be processed.

The Get Title action uses the Get attribute method to capture the title on the webpage and add it to the titles variable. The Set Result action uses the Set item result method to register the item's processing result, either as "OK" or "WARN".

Finally, a conditional action (More articles?) at the end of the workflow evaluates if index is greater than numberOfArticles. If not, the robotic process loops back over the earlier actions to process the remaining items. Once index is greater than numberOfArticles, the process ends.


This version of the Appian RPA documentation was written for Appian 21.4, and does not represent the interfaces or functionality of other Appian versions.
Open in Github Built: Tue, Nov 23, 2021 (07:31:45 PM)

On This Page

FEEDBACK