Variables in Actions Rivers
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Variables in Actions Rivers

  • Dark
    Light
  • PDF

Article Summary

Introduction

This document outlines the functionality and management of variables in REST Actions and Multi-Actions within Rivery. Variables serve as the interface between Actions and other components within the platform.

Types of Action Variables

  • Action Variables: These are manually inputted into the Action River and can be utilized as API URL parameters and as Headers values.
    • Interval Params: These are related to the selected Time Period of the Action River, prefixed with “time_range.”
  • Action Output Varialbes: These are used when there is a need to output a variable and employ it beyond the scope of the Action River. They are applicable in Logic, Multi-Action, and Rest-API Source to Target Rivers.

Accessing Variables

Action Variables

To access the variables interface, click the Variables button on the right side of the River interface.

Adding Variables to an Action

  1. Click Add Variable.
  2. Enter the name and value of the variable.
  3. Select is_private if you want the variable to remain restricted to the Action River, making it inaccessible in Source to Target Rivers or Logic Rivers.
  4. Opt for Add to Results to generate a new column in the results table that will display each instance of this variable's values.

image.png

Output Varialbes

Navigate to the Results menu and click on the Variables tab. In this section, you can create a variable in the Output Variable Field. Set this variable's value to reflect the outcome of your request. This data can be applied in Logic, Multi-Action, and Rest-API Source to Target Rivers.

image.png

Please Note:
Selecting the 'Hide Output Value' option ensures that the variable's value will not be shown in the Logs and will also remain inaccessible in Logic Rivers.

Scopes of Variables

  • Variables in a REST Action are accessible throughout the Action's configuration.
  • Multi-Actions have a distinct variable scope. Variables within an Action called within a Multi-Action are separate and do not share the Multi-Action's scope.
  • To pass variables from a Multi-Action to an Action within it, use the input variables of the internal action.

Using Variables in Actions

In REST Actions

Insert variables into any input fields using curly braces {}. A list of variables will appear for selection.
image.png

In Multi-Actions

Multi-Actions consist of multiple REST Actions. Variables are used in the input fields of actions within the Multi-Action. Additional 'output variables' are specific to Multi-Actions, capturing data returned from internal actions.

Additional Note

  • Environment Variables are not automatically displayed within Action Rivers. You can include them in the request body using curly brackets. Keep in mind that the request body is accessible in all requests except for "GET."
  • When a Time Period is selected, additional time components (e.g., “time_range.start_date.day”) become available in the variables list.

Was this article helpful?