Hide last authors
Outhman Moustaghfir 1.1 1 = SetVar Connector Documentation =
2
3 == Overview ==
4
Outhman Moustaghfir 3.2 5 [[image:setvar.png]]
6
Outhman Moustaghfir 5.1 7
Outhman Moustaghfir 1.1 8 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.
9
10 == Usage ==
11
12 === JSON Format ===
13
Outhman Moustaghfir 3.2 14 [[image:Capture d'écran 2024-01-30 150237.png]]
15
Outhman Moustaghfir 1.1 16 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.
17
18 ==== Example 1: ====
19
20 {{{
21 }}}
22
Outhman Moustaghfir 3.3 23 {{code language="json"}}
Outhman Moustaghfir 8.1 24 { "var1": "value1", "var2": "value2" }
Outhman Moustaghfir 1.1 25
26 {{/code}}
27
28
29 ==== Example 2: ====
30
31 {{{
32 }}}
33
Outhman Moustaghfir 3.4 34 {{code language="json"}}
Outhman Moustaghfir 10.1 35 { "var1": "value1", "var2": "${Env.GetVar;variableName}" }
Outhman Moustaghfir 1.1 36 {{/code}}
37
38
39 === Dynamic Values ===
40
Outhman Moustaghfir 10.1 41 SetVar supports dynamic values using iXPath functions (GetVar, Date, GetTracking...). This allows you to reference the values of other variables within the JSON file.
Outhman Moustaghfir 1.1 42
43 == Examples ==
44
45 === Setting Basic Variables ===
46
47 {{{
48 }}}
49
50 {{code language="json"}}
51 { "username": "john_doe", "email": "john.doe@example.com", "isAdmin": "false" }
52 {{/code}}
53
54
Outhman Moustaghfir 10.1 55 === Using Dynamic Values by GetVar function ===
Outhman Moustaghfir 1.1 56
57
58 {{code language="json"}}
Outhman Moustaghfir 10.1 59 { "username": "john_doe", "email": "${Env.GetVar;Email}", "isAdmin": "false"}
Outhman Moustaghfir 1.1 60 {{/code}}
61
62
63 == Important Notes ==
64
65 * Variables set by SetVar can be referenced within the same JSON file or in subsequent scenarios.
Outhman Moustaghfir 10.1 66 * Ensure proper syntax for dynamic values using **iXPath functions**.
Outhman Moustaghfir 1.1 67
68 == Conclusion ==
69
70 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.
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian