action-center
2023.10
true
  • Release notes
    • 2023.10.6
    • 2023.10.5
    • 2023.10.4
    • 2023.10.2
    • 2023.10.1
    • 2023.10.0
  • Before you begin
  • Getting started
  • Activities
  • Actions
  • Processes
  • Notifications
Action Center
Automation CloudAutomation Cloud Public SectorAutomation SuiteStandalone
Last updated Oct 17, 2024

PREVIEW
Creating action definitions

To bind the action input fields to the Apps fields, you need an Action definition.

1. Preparing the Action definition

Before you add the Action definition to Action Center, you have to create a JSON schema for it. The file should follow the JSON schema standard. You can also download the sample schema, edit and upload a modified version of it.

  1. Start by adding an open curly brace to indicate the start of the JSON object.
  2. Inside the JSON object, define the Name and Description properties as strings, along with their values.
    {
        "Name": "Sample Definition",
        "Description": "Sample Definition Description"{
        "Name": "Sample Definition",
        "Description": "Sample Definition Description"
    
  3. Add an Allowed Actions property as an array of strings to specify the allowed actions that you can take at the end of the action. The values should be the equivalent of Approve or Reject.
    "AllowedActions": [
            "Start On-boarding",
            "Request more details"
        ],"AllowedActions": [
            "Start On-boarding",
            "Request more details"
        ],
    
  4. Add a Schema property and assign it an object that adheres to the JSON Schema standard: 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. Within the properties object, define each property you want to include in the schema. For each property, specify its type and description.
    Each property in the Schema is the equivalent to the input fields you will add in the App action.
    "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."
                }
            }
    
    If you have nested objects, like address, according to this example, define them similarly within the properties object, specifying their type and properties.
  6. If certain properties are required, include a required array, where you list the properties that you want to mark as required in the action.
    "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. Close the JSON object by adding a closing curly brace.

2. Uploading action definition to Action Center

After you have created the JSON schema of the action definition, you can upload it in Action Center.

  1. Open Action Center, navigate to Admin Settings, and select Tenant.
  2. In the Action Definitions tab, select Add Action Definition.
  3. Select Download action definition sample to download a sample JSON schema to help you prepare the action definition.
  4. Select Import from file, and select the JSON file you prepared earlier.
  5. Enter an appropriate name and description for the Action definition, and then select Create.

Result: Now you can add the Action definition as a Control to your Action App within App Studio.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.