Free cookie consent management tool by TermsFeed

General Actions

On This Page

Overview

General actions help make your processes more organized and flexible.

General actions are listed in the General area of the palette.

Action group

Action groups help you organize actions that work together to achieve a desired outcome. For example, you may want to organize your workflow so that login actions are contained in an action group.

To add an action group to the workflow, click and drag Action Group from the Palette to a section.

Loop

Loops repeat actions until a condition is satisfied. Use the Loop action to process items in a list such as files in a directory or line items on an invoice. RPA supports the following loop types:

  • While: Executes the loop until the loop expression returns false.
  • Repeat: Executes the loop a fixed number of times, equal to the integer in the Iterations field.
  • For Each: Executes the loop for each item in a list.

Tip:  Loops can't repeat more than 1000 times.

In the following example, the loop will execute the Create a folder and Copy a file or folder actions until the Loop Expression returns false.

Screenshot of the loop action in the system

To add and configure a Loop action:

  1. Click and hold the Loop action in the Palette.
  2. Drag and drop the action to a section or action group.
  3. Select a loop type from the Configuration Pane.
  4. Configure additional properties from the Configuration Pane depending on the loop type.
    • While loops must have a loop expression.
    • Repeat loops must have a number specified in the Iterations field.
  5. Drag and drop additional actions from the Palette into the loop action. Actions will only repeat when inside the Loop action.

Action expressions in loops can reference function variables. Supported function variables in loops include:

Function Variable Description While Repeat For Each
fv!index The current iteration of the loop, starting at 1. Yes Yes Yes
fv!isFirst true for the first iteration of a loop, otherwise false. No Yes Yes
fv!isLast true for the last iteration of a loop, otherwise false. No Yes Yes
fv!itemCount The total number of loop iterations. No Yes Yes
fv!item The current item. No No Yes

Try-Catch

The Try-Catch action adds structured exception handling to a robotic task. It includes a Try section where you place actions that might fail, and a Catch section where you place recovery actions that run if any action in the Try section fails.

Use Try-Catch when a robotic task should recover from a predictable failure instead of ending the whole task. For example, a task can attempt an action that might fail, catch the failure, log it, and continue to the next item in a batch.

To add a Try-Catch action to the workflow, click and hold Try-Catch in the General area of the Palette, then drag and drop it to a section or action group. To respond differently to different failures, you can add standard conditional actions, such as Is expression true?, within the Catch section.

The Try-Catch action does not retry a failed action automatically. To repeat an action after a failure, place the Try-Catch action inside a Loop. In the Catch section, record the failure by writing to a variable. For example, you could use a variable that counts the number of attempts.

Catch behavior

A caught exception won't cause the robotic task to fail, instead the caught exception is recorded in the execution log at WARN level.

Supported function variables in the Catch section include:

Variable Description
fv!errorType The exception class name, for example NoSuchFileException.
fv!errorMessage The full Java stack trace for the error.
fv!errorActionName The action id, for example file-system->get-properties. This is not the name shown in the robotic task definition.

Using the Fail if condition

Note:  If the Catch section is not firing when you expect it to, check the Fail if setting on the actions in the Try section.

  • Fail if on: The action throws an exception on the configured condition, and that exception reaches the Catch section like any other.
  • Fail if off: The action does not throw, so there is no exception and the Try section continues—the Catch section does not fire.

Switch

The Switch action evaluates a single variable or expression and routes execution based on the result. Instead of chaining multiple conditional actions, you can use the Switch action to route a robotic task through more than two paths based on one value.

The Switch action evaluates its expression once, regardless of how many cases you define.

To add a Switch action to the workflow, click and hold Switch in the General area of the Palette, then drag and drop it to a section or action group.

Default branch

The Default branch is mandatory and handles any value that does not match a case. You cannot delete or relabel it. The Default branch guarantees that every runtime value has an explicitly defined path, which prevents a robotic task from silently skipping all routing logic for an unexpected value.

The Default branch supports two authored outcomes:

  • Leave the Default body empty to keep the robotic task running when no case matches.
  • Place a Throw Error action in the Default body to fail the execution with a message when no case matches.

Matching behavior

The Switch action uses exact, case-sensitive string equality to match the evaluated result to a case value. For example, Auto does not match auto. Non-text values are compared as strings. There is no range, inequality, regex, wildcard, or Boolean matching.

To handle an empty result—a blank field, an empty cell, or a missing attribute—define a dedicated flow with a blank value. If no blank case is defined, an empty result routes to the Default branch.

Feedback