Get Parameters
Gets the values of parameters previously created in the IBM RPA Control Center.
Command availability: IBM RPA SaaS and IBM RPA on premises
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
getParameters [--parameters(String)] [--mappings(String)] (Boolean)=success (StringDictionary<String>)=value
Dependencies
You must create a parameter previously in the IBM RPA Control Center. See Creating parameters for instructions.
Input parameter
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Key Names | parameters |
Optional |
Text |
The parameter's name. To enter more than one parameter, use a comma to separate it. You must choose either the Key Names or the Mappings input parameters to get the parameters. |
Mappings | mappings |
Optional |
Text |
The mapping of parameters. Enter the parameter's name in the Parameter field and a Text variable in the Value field. The Value field returns the parameter value.You must choose either the Key Names or the Mappings input parameters to get the parameters. |
Output parameter
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Success | success |
Boolean |
Returns True if all parameters were obtained successfully, otherwise returns False . |
Value | value |
String Dictionary<Text> |
Returns a Text dictionary containing the parameter's name and value. |
Example
The following code example demonstrates how to get some parameters by mapping them. The Get Parameters (getParameters
) command obtains the values of two parameters mapped in the Mappings field.
defVar --name firstParameterValue --type String
defVar --name secondParameterValue --type String
defVar --name withSuccess --type Boolean
defVar --name parameterValues --type StringDictionary --innertype String
// Gets the value of the parameters you've mapped.
getParameters --mappings "<ENTER_THE_FIRST_PARAMETER>=${firstParameterValue},<ENTER_THE_SECOND_PARAMETER>=${secondParameterValue}" withSuccess=success parameterValues=value
// Logs the values of the obtained parameters. Also, logs if the parameters were obtained successfully.
logMessage --message "Value of the first parameter: ${firstParameterValue}\r\nValue of the second parameter: ${secondParameterValue}\r\n\r\nParameters got successfully: ${withSuccess}\r\nString dictionary values: ${parameterValues}" --type "Info"