<
From version < 14.1 >
edited by Outhman Moustaghfir
on 2024/01/30 17:12
To version < 5.1 >
edited by Outhman Moustaghfir
on 2024/01/30 15:08
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -11,9 +11,8 @@
11 11  
12 12  === JSON Format ===
13 13  
14 -[[image:var.png]]
14 +[[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" }
24 +{ "var1": "value1", "var2": "true" }
26 26  
27 27  {{/code}}
28 28  
... ... @@ -33,13 +33,13 @@
33 33   }}}
34 34  
35 35  {{code language="json"}}
36 -{ "var1": "value1", "var2": "${Env.GetVar;variableName}" }
35 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } }
37 37  {{/code}}
38 38  
39 39  
40 40  === Dynamic Values ===
41 41  
42 -SetVar supports dynamic values using iXPath functions (GetVar, Date, GetTracking...). This allows you to reference the values of other variables within the JSON file.
41 +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.
43 43  
44 44  == Examples ==
45 45  
... ... @@ -53,11 +53,11 @@
53 53  {{/code}}
54 54  
55 55  
56 -=== Using Dynamic Values by GetVar function ===
55 +=== Using Dynamic Values ===
57 57  
58 58  
59 59  {{code language="json"}}
60 -{ "username": "john_doe", "email": "${Env.GetVar;Email}", "isAdmin": "false"}
59 +{ "username": "john_doe", "email": "${GetVar;Email}", "isAdmin": "false", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" }}
61 61  {{/code}}
62 62  
63 63  
... ... @@ -64,7 +64,7 @@
64 64  == Important Notes ==
65 65  
66 66  * Variables set by SetVar can be referenced within the same JSON file or in subsequent scenarios.
67 -* Ensure proper syntax for dynamic values using **iXPath functions**.
66 +* Ensure proper syntax for dynamic values using ${GetVar;variableName}.
68 68  
69 69  == Conclusion ==
70 70  
var.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.omoustaghfir
Size
... ... @@ -1,1 +1,0 @@
1 -14.3 KB
Content
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian