SetVar
SetVar Connector Documentation
Overview
The SetVar connector is designed to set variables within a scenario by utilizing a JSON file. This connector allows users to define variables and even use dynamic values using expressions.
Usage
JSON Format
The JSON file for SetVar has a simple structure. It consists of key-value pairs, where the keys represent variable names, and the values can be either static values or dynamic expressions.
Example 1:
Example 2:
Global Values
SetVar supports dynamic values using XGlobal before the variable name to make this var accessibel in the parent sceanrio .
Examples
Dynamic Values
SetVar supports globalvalues using iXPath functions (GetVar, Date, GetTracking...). This allows you to reference the values of other variables within the JSON file.
Examples
Setting Basic Variables
Using Dynamic Values by GetVar function
Important Notes
- Variables set by SetVar can be referenced within the same JSON file or in subsequent scenarios.
- Ensure proper syntax for dynamic values using iXPath functions.
- We can define variables using either a JSON file or by entering values in the content text area.
Conclusion
The SetVar connector simplifies the process of setting and managing variables within your scenarios. By providing both static and dynamic values, it offers flexibility and enhances the reusability of variable values across different parts of your workflow.