Rainforest now lets you use different tabular variables based on environment. You can do so by embedding {{rainforest.environment_id}} into an existing tabular variable to specify the appropriate column that should be for each environment. When the test is run, {{rainforest.environment_id}} is replaced by the actual environment ID of the run.

This feature is useful if you need to use different tabular variables based on which environment your test runs on. Without this feature, you would have to duplicate the same test and use a different tabular variable in each test, one per environment.

This is best illustrated by demonstrating how the feature works.

How It Works

1. Find the environment ID

  • Go to Settings > Sites and hover on an environment to see it’s ID.

2. Specify the environment IDs in each column header

  • In your tabular variable CSV, include the environment ID in the header of each column that you would like to associate with each environment. 
  • You may include the ID anywhere in the column title, as long as it is consistent throughout. 
  • In the example below, column B is intended to be associated with environment 557. 

3. Upload your file as you would any other tabular variable file

Once you upload the file, you will see a preview of which cells would be used depending on each environment.

4. Use your tabular variable in a test

  • When you write your test, use {{rainforest.environment_id}} to call the environment ID of the run. 
  • In the example below, the column var_{{rainforest.environment_id}} can be called inside the test_conditional_vars tabular variable file by writing   {{test_conditional_vars.var_{{rainforest.environment_id}}}} .

Once you run your test, Rainforest will use the column tied to the environment specified in the header. In this example, environment 5098 was used and returned value 4c, shown below, which was in the column corresponding to that environment.

Things to note:

  • Conditional Tabular variables are completely backwards compatible 

If you have any questions, please reach out to us at support@rainforestapp.com!

Did this answer your question?