Using variable looping to analyze river activity statistics
You can collect and analyze Rivers Activity Statistics using variable looping in Action Rivers. The primary objective is to gather data from various River Activities and present the required statistics through a comprehensive dataset.
To learn more about the fundamental concepts, refer to the Overview of Variable Looping.
Example use case
Obtaining specific rivers activity statistics through API integration
In this use case, the primary goal is to collect Rivers Activity Statistics using APIs. The process includes the following steps:
-
Retrieving data from Activities API: Accessing the Activities API to gather relevant information. This API provides data on various River Activities.
-
Loading data into Snowflake: After obtaining the data from the Activities API, the information is loaded into a data warehouse like Snowflake.
-
Populating data into a variable: Once the data is in Snowflake, it is extracted and stored in a variable. This variable holds the relevant information that will be used later in the process.
-
Creating a GET call for River activity statistics: In this step, a new GET call is made to another API specifically dedicated to River Activity Statistics. The API URL contains a crucial parameter for obtaining the desired data.
-
Iterating the variable in a loop: The variable populated is used to iterate through a loop. The loop repeatedly requests the River Activity Statistics API, using different values from the variable as the parameter in the API URL.
-
Loading data into Snowflake: As the loop progresses, data is retrieved from the River Activity Statistics API using the variable's values as parameters. Each data obtained in the loop is then loaded into Snowflake, building a comprehensive dataset.
-
Presenting the results: The required data is derived from the looped variable values. With all the data stored in Snowflake, the relevant data can be derived by analyzing and processing the gathered information.
Use case benefits
- Efficient data analysis: By leveraging API integration and looping in Data Integration, you can effectively analyze a bulk dataset of activities and extract essential statistics, thereby eliminating the need for manual processing.
- Scalability: The process can easily scale to handle a growing volume of activities, making it suitable for applications with expanding datasets.
- Customizability: The Action River can be tailored to meet specific requirements, letting you define parameters to focus on and activity statistics relevant to their needs.
Variable looping configuration steps
The process is categorized into six primary steps.
Procedure
Step 1: creating an API token
Before initiating any API calls, ensure proper authentication and authorization mechanisms are in place to access the required data.
Step 2: establishing the API connection (Action river)
In this step, you must access the Activities API to collect relevant information. The API offers data about various River Activities.
- Providing API URL
- Configuring the setup to retrieve an explicit field from the API response.
To obtain the Account and Environment IDs from the URL, follow the instructions:

- To learn more about the API Tokens, refer to the API Tokens.
Step 3: pushing activities API data to Snowflake (Source to Target river)
- Obtain data from the Action River created previously.
- Load the obtained information into a data warehouse, such as Snowflake.
Step 4: establish the loop (Action river)
Set up a loop to iterate over the obtained values from the Activities API response. Within the loop, construct secondary API calls, using each value as a parameter to fetch the relevant activity statistics.
To obtain the Account and Environment IDs from the URL, follow the instructions:

Step 5: loading cross ID data into Snowflake (Source to Target river)
- Gather statistics from the secondary API calls.
- Store the obtained statistics in a suitable data structure.
Step 6: trigger all rivers and get the results you need
This step concludes the entire process, during which all preceding steps are activated. Once this step is completed, you can view the API call's outcomes and the iterated values in your "Snowflake" warehouse.
- Using a query to extract and store information from the Target in a variable.
select CROSS_ID from {Your Database} where is_deleted=false
- Using the loop created in an Action River to iterate over the variable containing all relevant information.