Compartilhar via


elementActions object

Array of objects each representing a custom file handling action your app can perform when invoked by the user from the context menu of a file in Microsoft 365 (Office) app. See Actions in Microsoft 365 for further information.

Properties that reference this object type:

Syntax

{
  "id": "{string}",
  "intent": "create | addTo | open | preview | share | sign | custom",
  "displayName": "{string}",
  "description": "{string}",
  "icons": [
    {
      "size": {number},
      "url": "{string}"
    }
  ],
  "handlers": [
    {
      "type": "openURL | openPage | openDialog | openTaskpane | invokeAPI | invokeBot",
      "supportedObjects": {
        supportedObjects object
      },
      "supportsMultiSelect": {boolean},
      "pageInfo": {
        pageInfo object
      },
      "dialogInfo": {
        dialogInfo object
      },
      "url": "{string}",
      "botInfo": {
        botInfo object
      }
    }
  ]
}

Properties

id

An identifier string in the default locale that is used to catalog actions. Must be unique across all actions for this app. For example, openDocInContoso.

Type
string

Required

Constraints
Minimum string length: 1.

Supported values

intent

An enum string that describes the intent of the action.

Type
string

Required

Constraints

Supported values
Allowed values: create, addTo, open, preview, share, sign, custom.

displayName

A display name for the action. Capitalize first letter and brand name. For example, Add to suppliers, Open in Contoso, or Request signatures.

Type
string

Required

Constraints
Minimum string length: 1.

Supported values

description

A display string in the default locale that represents the action.

Type
string

Required

Constraints
Minimum string length: 1.

Supported values

icons

Object containing URLs to icon images for this action intent.

Type
Array of icons

Required

Constraints

Supported values

handlers

An array of handler objects defining how Actions are managed. In the current public preview, adds a single handler for each action.

Type
Array of handlers

Required

Constraints
Minimum array items: 1.

Supported values

Examples

{
"actions": [
    {
      "id": "addTodoTask",
      "displayName": "Add ToDo task",
      "intent": "addTo",
      "description": "Add this file with a short note to my to do list",
      "handlers": [
        {
          "type": "openPage",
          "supportedObjects": {
            "file": {
              "extensions": [
                "doc",
                "pdf"
              ]
            }
          },
          "pageInfo": {
            "pageId": "newTaskPage",
            "subPageId": ""
          }
        }
      ]
    },
  ]
}