Changes for page SetVar
Last modified by Outhman Moustaghfir on 2024/09/27 13:43
edited by Outhman Moustaghfir
on 2024/01/30 14:57
on 2024/01/30 14:57
edited by Outhman Moustaghfir
on 2024/01/30 17:11
on 2024/01/30 17:11
Change comment:
Uploaded new attachment "var.png", version {1}
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 3 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2,6 +2,9 @@ 2 2 3 3 == Overview == 4 4 5 +[[image:setvar.png]] 6 + 7 + 5 5 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. 6 6 7 7 == Usage == ... ... @@ -8,6 +8,8 @@ 8 8 9 9 === JSON Format === 10 10 14 +[[image:Capture d'écran 2024-01-30 150237.png]] 15 + 11 11 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. 12 12 13 13 ==== Example 1: ==== ... ... @@ -15,12 +15,11 @@ 15 15 {{{ 16 16 }}} 17 17 18 -{{code language=" XML"}}19 - SetVar(variable_name,value,global=False)23 +{{code language="json"}} 24 +{ "var1": "value1", "var2": "value2" } 20 20 21 21 {{/code}} 22 22 23 -{ "var1": "value1", "var2": "true" } 24 24 25 25 ==== Example 2: ==== 26 26 ... ... @@ -27,16 +27,14 @@ 27 27 {{{ 28 28 }}} 29 29 30 -{{code language="XML"}} 31 -SetVar(variable_name, value, global=False) 32 - 34 +{{code language="json"}} 35 +{ "var1": "value1", "var2": "${Env.GetVar;variableName}" } 33 33 {{/code}} 34 34 35 -{ "var1": "value1", "var2": "true", "inputFile1": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } } 36 36 37 37 === Dynamic Values === 38 38 39 -SetVar supports dynamic values using expressionsin the ${GetVar;variableName}format. This allows you to reference the values of other variables within the JSON file.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. 40 40 41 41 == Examples == 42 42 ... ... @@ -50,11 +50,11 @@ 50 50 {{/code}} 51 51 52 52 53 -=== Using Dynamic Values === 55 +=== Using Dynamic Values by GetVar function === 54 54 55 55 56 56 {{code language="json"}} 57 -{ " var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2"}}59 +{ "username": "john_doe", "email": "${Env.GetVar;Email}", "isAdmin": "false"} 58 58 {{/code}} 59 59 60 60 ... ... @@ -61,7 +61,7 @@ 61 61 == Important Notes == 62 62 63 63 * Variables set by SetVar can be referenced within the same JSON file or in subsequent scenarios. 64 -* Ensure proper syntax for dynamic values using ${GetVar;variableName}.66 +* Ensure proper syntax for dynamic values using **iXPath functions**. 65 65 66 66 == Conclusion == 67 67
- Capture d'écran 2024-01-30 150237.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.omoustaghfir - Size
-
... ... @@ -1,0 +1,1 @@ 1 +14.9 KB - Content
- setvar.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.omoustaghfir - Size
-
... ... @@ -1,0 +1,1 @@ 1 +3.6 KB - Content
- var.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.omoustaghfir - Size
-
... ... @@ -1,0 +1,1 @@ 1 +14.3 KB - Content