Action Center
2023.10
Action Center
Last updated 2024年6月27日

プレビュー
アクションの定義を作成する

アクションの入力フィールドを Apps のフィールドにバインドするには、アクションの定義が必要です。

1. アクションの定義を準備する

Action Center にアクションの定義を追加する前に、JSON スキーマを作成する必要があります。このファイルは JSON スキーマの標準に従う必要があります。また、サンプル スキーマをダウンロードして編集し、変更後のバージョンをアップロードすることもできます。

  1. まず、JSON オブジェクトの開始を示す左中括弧を追加します。
  2. JSON オブジェクト内で、Name プロパティと Description プロパティを文字列として定義し、値を入れます。
    {
        "Name": "Sample Definition",
        "Description": "Sample Definition Description"{
        "Name": "Sample Definition",
        "Description": "Sample Definition Description"
    
  3. Allowed Actions プロパティを文字列の配列として追加し、アクションの最後に実行を許可するアクションを指定します。この値は、承認または却下と同等のものである必要があります。
    "AllowedActions": [
            "Start On-boarding",
            "Request more details"
        ],"AllowedActions": [
            "Start On-boarding",
            "Request more details"
        ],
    
  4. Schema プロパティを追加し、JSON スキーマ標準 http://json-schema.org/draft-07/schema# に準拠したオブジェクトを割り当てます。
    "Schema": {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "type": "object","Schema": {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "type": "object",
    
  5. properties オブジェクト内で、スキーマに含める各プロパティを定義します。プロパティごとに、typedescription を指定します。
    Schema の各プロパティは、アプリ アクションに追加する入力フィールドと同等です。
    "properties": {
                "employee_id": {
                    "type": "string",
                    "description": "The unique identifier of the employee."
                },
                "first_name": {
                    "type": "string",
                    "description": "The first name of the employee."
                },
                "last_name": {
                    "type": "string",
                    "description": "The last name of the employee."
                },
                "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The email address of the employee."
                },
                "address": {
                    "type": "object",
                    "properties": {
                        "street": {
                            "type": "string",
                            "description": "The street address of the employee."
                        },
                        "city": {
                            "type": "string",
                            "description": "The city where the employee resides."
                        },
                        "state": {
                            "type": "string",
                            "description": "The state where the employee resides."
                        },
                        "zip_code": {
                            "type": "string",
                            "description": "The zip code of the employee's address."
                        },
                        "country": {
                            "type": "string",
                            "description": "The country where the employee resides."
                        }
                    },
                    "required": [
                        "street",
                        "city",
                        "state",
                        "zip_code",
                        "country"
                    ],
                    "description": "The address of the employee."
                },
                "hire_date": {
                    "type": "string",
                    "format": "date",
                    "description": "The date the employee was hired in the format YYYY-MM-DD."
                },
                "salary": {
                    "type": "number",
                    "minimum": 0,
                    "description": "The salary of the employee."
                }
            }"properties": {
                "employee_id": {
                    "type": "string",
                    "description": "The unique identifier of the employee."
                },
                "first_name": {
                    "type": "string",
                    "description": "The first name of the employee."
                },
                "last_name": {
                    "type": "string",
                    "description": "The last name of the employee."
                },
                "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The email address of the employee."
                },
                "address": {
                    "type": "object",
                    "properties": {
                        "street": {
                            "type": "string",
                            "description": "The street address of the employee."
                        },
                        "city": {
                            "type": "string",
                            "description": "The city where the employee resides."
                        },
                        "state": {
                            "type": "string",
                            "description": "The state where the employee resides."
                        },
                        "zip_code": {
                            "type": "string",
                            "description": "The zip code of the employee's address."
                        },
                        "country": {
                            "type": "string",
                            "description": "The country where the employee resides."
                        }
                    },
                    "required": [
                        "street",
                        "city",
                        "state",
                        "zip_code",
                        "country"
                    ],
                    "description": "The address of the employee."
                },
                "hire_date": {
                    "type": "string",
                    "format": "date",
                    "description": "The date the employee was hired in the format YYYY-MM-DD."
                },
                "salary": {
                    "type": "number",
                    "minimum": 0,
                    "description": "The salary of the employee."
                }
            }
    
    この例の address のようにネストされたオブジェクトがある場合は、properties オブジェクト内で同様にオブジェクトを定義し、その型とプロパティを指定します。
  6. 特定のプロパティが必要な場合は、アクションで必須としてマークするプロパティをリストする required 配列を含めます。
    "required": [
                "employee_id",
                "first_name",
                "last_name",
                "email",
                "address",
                "salary",
                "hire_date"
            ]"required": [
                "employee_id",
                "first_name",
                "last_name",
                "email",
                "address",
                "salary",
                "hire_date"
            ]
    
  7. 右中括弧を追加して JSON オブジェクトを閉じます。

2. アクションの定義を Action Center にアップロードする

アクションの定義の JSON スキーマを作成したら、Action Center にアップロードできます。

  1. Action Center を開き、[管理者設定] に移動して [テナント] を選択します。
  2. [アクションの定義] タブで、[アクションの定義を追加] を選択します。
  3. [アクションの定義のサンプルをダウンロード] を選択して、アクション定義の準備に役立つサンプル JSON スキーマをダウンロードします。
  4. [ファイルからインポート] を選択し、先ほど準備した JSON ファイルを選択します。
  5. アクション定義の適切な名前と説明を入力し、[作成] を選択します。

結果: App Studio 内のアクション アプリに、アクションの定義をコントロールとして追加できるようになりました。

Was this page helpful?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
UiPath ロゴ (白)
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.