Changes for page SetVar
Last modified by Outhman Moustaghfir on 2024/09/27 13:43
<
>
edited by Outhman Moustaghfir
on 2024/01/30 15:03
on 2024/01/30 15:03
edited by Outhman Moustaghfir
on 2024/01/30 15:10
on 2024/01/30 15:10
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -4,6 +4,7 @@ 4 4 5 5 [[image:setvar.png]] 6 6 7 + 7 7 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. 8 8 9 9 == Usage == ... ... @@ -30,16 +30,14 @@ 30 30 {{{ 31 31 }}} 32 32 33 -{{code language="XML"}} 34 -SetVar(variable_name, value, global=False) 35 - 34 +{{code language="json"}} 35 +{ "var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } } 36 36 {{/code}} 37 37 38 -{ "var1": "value1", "var2": "true", "inputFile1": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" } } 39 39 40 40 === Dynamic Values === 41 41 42 -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. 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 ... ... @@ -57,7 +57,7 @@ 57 57 58 58 59 59 {{code language="json"}} 60 -{ " var1": "value1", "var2": "${GetVar;inputFile}", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" }59 +{ "username": "john_doe", "email": "${GetVar;Email}", "isAdmin": "false", "nestedVar": { "nestedVar1": "val1", "nestedVar2": "val2" }} 61 61 {{/code}} 62 62 63 63