Changes for page SetVar
Last modified by Outhman Moustaghfir on 2024/09/27 13:43
<
>
edited by Outhman Moustaghfir
on 2024/03/11 17:14
on 2024/03/11 17:14
edited by Outhman Moustaghfir
on 2024/01/30 15:04
on 2024/01/30 15:04
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 1 removed)
Details
- Page properties
-
- Content
-
... ... @@ -4,7 +4,6 @@ 4 4 5 5 [[image:setvar.png]] 6 6 7 - 8 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 9 10 10 == Usage == ... ... @@ -11,9 +11,8 @@ 11 11 12 12 === JSON Format === 13 13 14 -[[image: var.png]]13 +[[image:Capture d'écran 2024-01-30 150237.png]] 15 15 16 - 17 17 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. 18 18 19 19 ==== Example 1: ==== ... ... @@ -22,7 +22,7 @@ 22 22 }}} 23 23 24 24 {{code language="json"}} 25 -{ "var1": "value1", "var2": " value2" }23 +{ "var1": "value1", "var2": "true" } 26 26 27 27 {{/code}} 28 28 ... ... @@ -33,23 +33,13 @@ 33 33 }}} 34 34 35 35 {{code language="json"}} 36 -{ "var1": "value1", "var2": "{ Env.GetVar;variableName}" }34 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } } 37 37 {{/code}} 38 38 39 -== Global Values == 40 40 41 -SetVar supports dynamic values using XGlobal before the variable name to make this var accessibel in the parent sceanrio . 42 - 43 -== Examples == 44 - 45 - 46 -{{code language="json"}} 47 -{ "iXGlobal:Key": "Value" } 48 -{{/code}} 49 - 50 50 === Dynamic Values === 51 51 52 -SetVar supports globalvalues using iXPath functions(GetVar, Date, GetTracking...).This allows you to reference the values of other variables within the JSON file.40 +SetVar supports dynamic values using expressions in the ${GetVar;variableName} format. This allows you to reference the values of other variables within the JSON file. 53 53 54 54 == Examples == 55 55 ... ... @@ -63,11 +63,11 @@ 63 63 {{/code}} 64 64 65 65 66 -=== Using Dynamic Values by GetVar function===54 +=== Using Dynamic Values === 67 67 68 68 69 69 {{code language="json"}} 70 -{ " username": "john_doe", "email": "{Env.GetVar;Email}", "isAdmin": "false"}58 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } } 71 71 {{/code}} 72 72 73 73 ... ... @@ -74,7 +74,7 @@ 74 74 == Important Notes == 75 75 76 76 * Variables set by SetVar can be referenced within the same JSON file or in subsequent scenarios. 77 -* Ensure proper syntax for dynamic values using **iXPath functions**.65 +* Ensure proper syntax for dynamic values using ${GetVar;variableName}. 78 78 79 79 == Conclusion == 80 80
- var.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.omoustaghfir - Size
-
... ... @@ -1,1 +1,0 @@ 1 -14.3 KB - Content