Skip to main content
Tutorials

Chaining actions

Chaining actions

One of the Designer's most capable features is chaining actions — using one action's result as another's input. That is what lets you build complex flows where each action builds on what came before.


How it works

When the robot runs an action, it stores that action's outputs under the action's ID. To reach those values from another action, reference action_id.field.


In practice

Take a flow that signs into a web system:

1. [Open Browser] → ID: openBrowser
Output available: the browser session

2. [Get element] → ID: getPasswordField
Uses: openBrowser (the browser session)
Selector: input#password
Output available: the password field's element

3. [Insert text]
Uses: getPasswordField.element (the field from the previous action)
Text: ••••••••

In this flow:

  • Action 2 uses the browser session created by action 1
  • Action 3 uses the element found by action 2

Referencing an output, step by step

  1. In a later action in the flow, find the field you want to fill with the output.
  2. Click the type icon on the left of the field (dynamic fields).
  3. In the window that opens, go to the Robot actions tab.
  4. Find the action whose output you want (actions are listed by ID).
  5. Expand it and select the output field you want (value, element, filePath).
  6. The field then reads actionId.field (e.g. getText.value).
info

Only actions that come before the current one in the flow are available to reference. Later actions cannot be referenced.


Enabling output fields

For an action's output to be available to other actions, it has to be enabled in the Output fields section of the action that produces it.

To enable one:

  1. Click the action that produces the output.
  2. In the settings panel, expand Output fields.
  3. Tick the checkbox next to the fields you want to use elsewhere.
  4. Save the action.
tip

Only enable the output fields you actually need later in the flow. It keeps the flow tidy and makes the returns easier to find when configuring the actions that follow.


Good practice

Use descriptive IDs

Rather than keeping the automatic IDs the Designer generates, use names that say what the action is for:

  • action1, action2, action3
  • openBrowser, getPasswordField, signIn

It makes the flow readable and easier to maintain.

Check the references before changing an ID

Changing the ID of an action other actions already reference breaks those references. Always check what depends on an output before renaming the action that produces it.

Order the flow logically

Keep the actions in a clear, logical order. Actions that produce outputs belong before the actions that consume them.


Chaining in code fields

In a dynamic field's Code mode you reach the actions object directly to reference earlier outputs:

typescript
// Syntax: actions["action_id_or_alias"]["output_field"]
const text = actions["getText"]["value"]
const element = actions["findButton"]["element"]

// Building a message out of two outputs
const message = `${actions["readName"]["value"]}${actions["readCode"]["value"]}`
return message

The action's ID is at the top of its settings panel in the Designer. If the action has an alias, use the alias instead of the ID.

tip

The code editor autocompletes earlier actions' outputs. Type actions[" and it suggests the available actions and their output fields.


Next