Skip to main content

Get Global Variable

Command description

Gets a global variable previously set by Set Variable and saves its value to a new local variable. The equivalent Python code is:

new_local_variable = global_vars.variable_name

Command Input Parameters

input parametersInput parameter typeDescription
Global Variable NamestrName of the global variable
Variable TypeenumAny, Text, Integer, Float, Number, Boolean, DateTime, List, Map, Web Element, Web Page, Desktop Element, Excel Object, Text List, Integer List, Float List, Number List, Boolean List, Web Element List, Web Page List, Desktop Element List, Excel Object List

Command Output Parameters

Output parametersOutput parameter typeDescription
New Local VariableanyLocal variable that receives the global variable's value

Example

[
{
"ins": "Set Variable",
"in": {
"Variable Type": "'Map'",
"Variable Value": "{'Name': 'John Doe', 'Age': 25, 'City': 'New York'}",
"Global Variable": "True"
},
"out": {
"Variable Name": "userInfo"
}
},
{
"ins": "Get Global Variable",
"in": {
"Global Variable Name": "'userInfo'",
"Variable Type": "'Map'"
},
"out": {
"New Local Variable": "local_var"
}
},
{
"ins": "Print Log",
"in": {
"Log Content": "f'''{local_var['Name']} {local_var['Age']}'''",
"Render HTML": "False",
"Log Type": "'INFO'"
}
}
]