Skip to main content
Variable precedence in Requestly ensures that when multiple variables with the same name exist, the most relevant one is chosen based on scope. The precedence order is as follows:
Environment Variables → SubCollection Variables → Collection Variables → Global Variables
In other words:
  • Environment variables always take the highest priority and override any variable with the same name in other scopes.
  • If no matching environment variable exists, Requestly checks for the variable in the collection scope.
  • Global variables serve as a fallback when the variable is not found in the environment or collection scopes.
This approach simplifies managing configurations across different use cases, ensuring that environment-specific values are prioritized without interfering with globally defined values. Or in developer’s languages:

Example Scenario

Let’s say the variable {{base_url}} is defined in multiple places: If you send a request inside the SubCollection with an active Environment, the variable {{base_url}} will resolve to https://env.api.com because environment variables have the highest precedence.