variable[] method

Returns the value of an HCL character variable.

Note

You must first create the HCL variable and assign a value in the Variables window in the Robots script editor. Unlike Python variables, you cannot create HCL variables directly in a script.

Syntax

hcl.variable["variable_name"]

Parameters

Name Description
variable_name

The name of the HCL character variable.

Returns

String.

Examples

Return the value of an HCL character variable

Returns Sales, which is the value of the v_department HCL variable.

hcl.variable["v_department"]

Remarks

For more information, see Using variables in a Python/HCL script.