Skip to main content
Feedback

Managing variables in action rivers

You can manage variables in REST Actions and Multi Action within Data Integration. Variables serve as the interface between Actions and other components within the platform.

Action variables types

  • Action Variables: These are manually added into the Action River and can be used as API URL parameters and as Header values.
    • Interval Params: These are related to the selected Time Period of the Action River, prefixed with time_range.
  • Action Output Variables: These are used when a variable needs to be output and employed beyond the scope of the Action River. They apply in Logic, Multi Action, and Rest-API Source to Target Rivers.

Accessing variables

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

Adding variables to an action

  1. Navigate to the Data Integration Console.
  2. Click the River tab from the left-hand menu.
  3. Click Build Your Own to create an Action river or choose a existing river from the list.
  4. Select the desired action type.
  5. Click Add Variable.
  6. Enter the name and value of the variable.
  7. 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.
  8. Opt for Add to Results to generate a new column displaying each instance of this variable's values in the results table.

Output variables

  1. Navigate to the Results menu.
  2. Click the Variables tab.
  3. Create a variable in the Output Variable Field.
  4. Set the variable's value to reflect the outcome of your request.
  5. Use this variable in Logic, Multi Action, and REST-API Source to Target Rivers.
note

Selecting the Hide Output Value option hides the variable's value in the logs, making it inaccessible in Logic Rivers.

Scopes of variables

  • Variables defined in a REST Action are available throughout that Action’s entire configuration.
  • A Multi Action has its own separate variable scope. Variables inside an Action that is called from within a Multi Action do not automatically share the Multi Action’s variables.
  • To pass values from a Multi Action to one of its internal Actions, use the input variables of the internal Action.

Using variables in actions

REST action

Enter variables into any input fields using curly braces . A list of variables appears for selection.

image.png

Multi action flow

A Multi Action consists of multiple REST Actions. Variables are used in the input fields of actions within the Multi Action. Additional output variables are specific to the Multi Action and capture data returned from internal actions.

Configuring a Multi Action river with OAuth token authentication

This example demonstrates how to configure a Multi Action river in Data Integration to authenticate using OAuth 2.0 (Client Credentials Flow), retrieve an access token, and then use that token to call a protected API.

In this scenario, the Multi Action chains two REST Actions:

  1. Authenticate and retrieve an access token
  2. Use the token to call a protected API endpoint

Procedure

Step 1: Create a Multi Action river

  1. Navigate to the Data Integration Console.
  2. Click the Create Rivers → Build Your Own → Select Multi Action Flow.
  3. Select an existing Action or click New Action to add your first step.
  4. Create a connection with OAuth Client Credentials or choose the existing one.

Retrieve access token (Action step 1)

Set up a POST request to your token endpoint to retrieve the access token (bearer token).

REST Action configuration

FieldValue
MethodPOST
URLhttps://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
Content-Typeapplication/x-www-form-urlencoded

Request Body

FieldValue
Request Bodygrant_type=client_credentials&client_id={client_id}&client_secret={client_secret}&scope=https://management.azure.com/.default

Configuring output variable

  1. Select Results > Variables tab.
  2. In the Variables To Return section, create an output variable named access_token.
  3. Set its value to the JSON path: $.access_token.
  4. (Optional) Select Hide Output Value to keep the token hidden in logs.

Step 3: Call API with token (Action step 2)

After successfully posting to the token endpoint, you can reference the access_token in an output variable using JSON path.

REST Action configuration

FieldValue
MethodGET
URLhttps://management.azure.com/subscriptions?api-version=2022-12-01

Headers

HeaderValue
AuthorizationBearer {access_token}
note

Use curly braces {access_token} to reference the variable from Step 1. The system displays available variables for selection when you type {.

Step 4: Map variable scopes

When using a Multi Action, variables defined at the Multi Action level are not automatically available to the internal Actions. Each Action maintains its own scope. To use a Multi Action variable within an internal Action, pass the variable through the internal Action’s input variables.

You need to explicitly set access_token as an output variable when getting the Access Token, and reference it when calling the API with the Token header configuration.

Click Test Multi Action to verify that the authentication and data retrieval chain is working correctly.

info

This works for any OAuth 2.0 client credentials flow that requires chaining authentication with data retrieval.

note
  • Environment variables are not automatically displayed within Action Rivers. You can include them in the request body using curly brackets. The request body is accessible in all requests except GET.
  • When a Time Period is selected, additional time components (time_range.start_date.day) become available in the variables list.
On this Page