Using Robotic Process Variables

Robotic processes automate routine tasks, notably those involving data input and retrieval. You can use robotic process variables to pass data between workflow actions, and even between your robotic process and other design objects.

When you call a robotic process, you can pass data in through the parameters. When querying the results of a robotic process, all variables are returned, so you can use them within other objects of your application. Robotic process variables are typed like other Appian variables, and you can even use custom data types (CDTs) to easily pass complex data between objects.

This page provides an overview of how robotic process variables flow through your robotic process. Unfamiliar with how to get started? Learn how to create robotic process variables when configuring your robotic process.

Passing data

Similar to process variables in a process model, robotic process variables are placeholders for data that can be accessed throughout the lifecycle of a robotic process. Robotic process variables can be called at the beginning of the execution to pass initial values, and throughout the process using low-code modules in your workflow or Java methods in your source code.

Using parameterized variables

When creating robotic process variables, you have the option to mark the variable as a parameter. Parameterized variables allow you to add custom inputs to your robotic process’s execution, such as a search term for a website or a CDT of data to enter into a form. This data is often required for the robotic process to execute and its value can be used later on in the process. Think of parameterized variables like process parameters in a process model: when you create a process variable, you can mark it as a parameter so you can pass a value at the start of the process model.

To pass values to your parameterized variables at the start of the robotic process, use the Execute Robotic Process smart service. Using this smart service, you can configure node inputs to pass one or multiple values to your process. Later on, you'll use this same smart service to retrieve the results of the robotic process. For manual executions from the Appian RPA console, you can supply a value to the input field on the Execution options page. However, executions from the console can only pass one value to a parameterized variable, even if your parameterized variable is set to support multiple values.

Using low-code modules

To pass robotic process variables throughout your workflow, you can reference them in low-code modules. From these modules, you can use process variables as parameters in a method or use them to store the results of a method.

When you have a robotic process variable that is a CDT, you can reference individual fields of the CDT using dot notation. For example, if you have a process variable called myInvoice that uses an existing CDT called Invoice, you could use myInvoice.invoiceContact to save the name of the contact person on the invoice to the invoiceContact field of your CDT.

process variables cdt reference

After the robotic process collects this data, it can be passed to the next workflow action or saved to the database when your robotic process is part of a process model.

Using Java methods

For instances where you can't use low-code actions, you can also use robotic process variables in Java using the getWorkflowVariables() method of the IJidokaServer instance. This method returns a list of robotic process variables referenced in the workflow.

After retrieving the list of variables, you can then use the IRobotVariable interface to retrieve and modify the information about individual variables.

You cannot update a variable's CDT value from the source code. To update a field in a CDT, you must use a low-code module.

For example:

1
2
3
4
5
6
7
8
//Gets the map of workflow variables containing those defined on the configuration page
Map<String, IRobotVariable> variables = server.getWorkflowVariables();

// Gets the variable called "var1"
IRobotVariable rv = variables.get("var1");

// Updates the value of var1 to the current value of item
rv.setValue(item);

To retrieve parameterized variables in your source code, use the getWorkflowParameters() method in the server instance. This method returns a list of parameterized variables defined in the console. The parameterized variables are also represented as IRobotVariable.

Retrieving results

You’ll use the Execute Robotic Process smart service to kick off a robotic process in Appian RPA as part of a process model. The smart service returns the robotic process variables as node outputs. You can use this data later in the process model, or configure it so it’s saved to the database when it’s returned.

If you save the return values to the database, you can then use them throughout your Appian application. For example, in an interface, robotic process variables operate in ways similar to rule inputs. Map the results of a robotic process execution to rule inputs to create an interface that quickly summarizes key data. You can use robotic process variables in this way to create data visualizations such as dashboards and charts.

How the data flows together

This section describes an example scenario to help demonstrate how the data flows through a business application and a robotic process.

This example is a common task: checking the status of a shipment by looking at the vendor’s website. You can use a process model and robotic process to check the status at a regular interval and display the results as needed, or notify the appropriate group when the status changes.

Looking to learn how to build a robotic process using low-code actions? See Low-Code Robotic Processes for more specific steps on configuring the robotic process.

There are two key variables in this scenario: the tracking number and status. The tracking number is necessary as input on the web form, and the status is the data to capture. Robotic process variables allow you to share this information between Appian and Appian RPA.

In this example, a business uses a generic email inbox to receive shipment notifications. A process model receives these emails and parses the information within it, specifically finding the tracking number for a given shipment. The shipment information is saved in a CDT called “Incoming_inventory”.

In Appian RPA, there’s a “Check shipment status” robotic process, which will automatically check the USPS website to see the latest shipment status. In the robotic process configuration, a robotic process variable is mapped to the “Incoming_inventory” CDT. In the workflow, there are actions to launch the USPS website, use the tracking number as form input, and find and capture shipment's tracking status from the results page.

package-workflow

Back in Appian, a second process model is set to execute every day at 9AM to check the status of all shipments in progress. It uses the “Incoming_inventory” CDT as process variables to get started. The Execute robotic process smart service calls the “Check shipment status” robotic process and uses the “Incoming_inventory” CDT as inputs, passing the tracking number to the robotic process.

“Check shipment status” begins execution. It launches a web browser, navigates to USPS.com, finds the tracking number field, fills the field with a tracking number, and submits the form. After the results load, the robotic process finds the status and saves it as a variable in the CDT.

tracking-number

When the robotic process execution finishes, the smart service returns the results to the process model. Finally, the process model writes the updated information to the database, where it can be shown in the application as needed: in a record, user input task, or interface.

The entire end-to-end process will appear as follows:


This version of the Appian RPA documentation was written for Appian 21.1, and does not represent the interfaces or functionality of other Appian versions.
Open in Github

On This Page

FEEDBACK