複数パラメーターの取得

IBM RPA Control Centerで以前に作成されたパラメーターの値を取得します。

コマンドの可用性: IBM RPA SaaS および IBM RPA オンプレミス

スクリプト構文

IBM RPA の専有スクリプト言語の構文は、他のプログラミング言語と似ています。 スクリプト構文は、スクリプト・ファイル内のコマンドの構文を定義します。 この構文は、 IBM RPA Studioの 「スクリプト」 モードで操作できます。

getParameters [--parameters(String)] [--mappings(String)] (Boolean)=success (StringDictionary<String>)=value

依存関係

事前に IBM RPA Control Centerでパラメーターを作成しておく必要があります。 手順については、パラメーターの作成を参照してください。

入力パラメーター

以下の表は、このコマンドで使用可能な入力パラメーターのリストを示しています。 この表では、 IBM RPA Studioのスクリプト・モードで作業しているときのパラメーター名と、それに相当する Designer モードのラベルを確認できます。

「デザイナー」モードのラベル 「スクリプト」モードの名前 必須 使用可能な変数タイプ 説明
キー名 parameters Optional Text パラメーターの名前。 複数のパラメーターを入力するには、コンマを使用して区切ります。

パラメーターを取得するには、「キー名」入力パラメーターまたは「マッピング」入力パラメーターのいずれかを選択する必要があります。
マッピング mappings Optional Text パラメーターのマッピング。 「パラメーター」フィールドにパラメーターの名前を入力し、「値」フィールドに Text 変数を入力します。 「値」フィールドはパラメーター値を返します。

パラメーターを取得するには、「キー名」入力パラメーターまたは「マッピング」入力パラメーターのいずれかを選択する必要があります。

出力パラメーター

「デザイナー」モードのラベル 「スクリプト」モードの名前 使用可能な変数タイプ 説明
成功 success Boolean すべてのパラメーターが正常に取得された場合は True を返し、それ以外の場合は False を返します。
value String Dictionary<Text> パラメーターの名前と値を含む Text dictionary を返します。

例:

以下のコード例は、いくつかのパラメーターをマッピングによって取得する方法を示しています。 「パラメーターの取得」 (getParameters) コマンドは、「マッピング」フィールドにマップされた 2 つのパラメーターの値を取得します。

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"