|
| 1 | +--- |
| 2 | +title: Action JSON schema for Action Framework providers |
| 3 | +description: Describes the format of the action definition JSON file format for Action Framework. |
| 4 | +ms.topic: article |
| 5 | +ms.date: 02/04/2025 |
| 6 | +ms.localizationpriority: medium |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +# Action JSON schema for Action Framework providers |
| 12 | + |
| 13 | +Describes the format of the action definition JSON file format for Action Framework. |
| 14 | + |
| 15 | +## Example action definition JSON file |
| 16 | + |
| 17 | +```json |
| 18 | +"version": 1, |
| 19 | + "actions": [ |
| 20 | + { |
| 21 | + "id": "Contoso.SampleGreeting", |
| 22 | + "description": "A simple greeting action.", |
| 23 | + "icon": "ms-resource//...", |
| 24 | + "inputs": [ |
| 25 | + { |
| 26 | + "name": "UserFriendlyName", |
| 27 | + "kind": "Text" |
| 28 | + }, |
| 29 | + { |
| 30 | + "name": "PetName", |
| 31 | + "kind": "Text", |
| 32 | + "required": false |
| 33 | + } |
| 34 | + ], |
| 35 | + "inputCombinations": [ |
| 36 | + { |
| 37 | + "inputs": ["UserFriendlyName"], |
| 38 | + "description": "Greet ${UserFriendlyName.Text}" |
| 39 | + }, |
| 40 | + { |
| 41 | + "inputs": ["UserFriendlyName", "PetName"], |
| 42 | + "description": "Greet ${UserFriendlyName.Text} and their pet ${PetName.Text}" |
| 43 | + } |
| 44 | + ], |
| 45 | + "contentAgeRating": "child", |
| 46 | + "invocation": |
| 47 | + { |
| 48 | + { |
| 49 | + "type": "Uri", |
| 50 | + "uri": "contoso://greetUser? userName=${UserFriendlyName.Text}&petName=${PetName.Text}", |
| 51 | + }, |
| 52 | + "where": [ |
| 53 | + "${UserFriendlyName.Text.Length > 3}" |
| 54 | + ] |
| 55 | + } |
| 56 | + }, |
| 57 | + { |
| 58 | + "id": "Contoso.SampleGetText", |
| 59 | + "description": "Summarize a file", |
| 60 | + "icon": "ms-resource://...", |
| 61 | + "inputs": [ |
| 62 | + { |
| 63 | + "name": "FileToSummarize", |
| 64 | + "kind": "File" |
| 65 | + } |
| 66 | + ], |
| 67 | + "inputCombinations": [ |
| 68 | + { |
| 69 | + "inputs": ["FileToSummarize"], |
| 70 | + "description": "Summarize ${FileToSummarize.Path}" |
| 71 | + }, |
| 72 | + ], |
| 73 | + "outputs": [ |
| 74 | + { |
| 75 | + "name": "Summary", |
| 76 | + "kind": "Text" |
| 77 | + } |
| 78 | + ], |
| 79 | + "contentAgeRating": "child", |
| 80 | + "invocation": { |
| 81 | + "type": "COM", |
| 82 | + "clsid": "{...}" |
| 83 | + } |
| 84 | + } |
| 85 | + ] |
| 86 | +} |
| 87 | +``` |
| 88 | + |
| 89 | +## Action definition JSON properties |
| 90 | + |
| 91 | +The tables below describe the properties of the action definition JSON file. |
| 92 | + |
| 93 | +### Document root |
| 94 | + |
| 95 | +| Property | Type | Description | Required | |
| 96 | +|----------|------|-------------|----------| |
| 97 | +| version | string | Schema version. When new functionality added, the version increments by one. | Yes. | |
| 98 | +| actions | Action[] | Defines the actions provided by the app. | Yes. | |
| 99 | + |
| 100 | +### Action |
| 101 | + |
| 102 | +| Property | Type | Description | Required | |
| 103 | +|----------|------|-------------|----------| |
| 104 | +| id | string | Action identifier. Must be unique per app package. This value is not localizable. | Yes | |
| 105 | +| description | string | User-facing description for this action. This value is localizable. | Yes | |
| 106 | +| icon | string | Localizable icon for the action. This value is an *ms-resource* string for an icon deployed with the app. | No | |
| 107 | +| inputs | Inputs[] | List of entities that this action accepts as input. | Yes | |
| 108 | +| inputCombinations | InputCombination[] | Provides descriptions for different combinations of inputs. | Yes | |
| 109 | +| outputs | Output[] | If specified, must be an empty string in the current release. | No | |
| 110 | +| invocation | Invocation | Provides information about how the action is invoked. | Yes | |
| 111 | +| contentAgeRating | string | A field name from the [UserAgeConsentGroup](/uwp/api/windows.system.userageconsentgroup)that specifies the appropriate age rating for the action. The allowed values are "Child", "Minor", "Adult". If no value is specified, the default behavior allows access to all ages. | No | |
| 112 | + |
| 113 | +### Output |
| 114 | + |
| 115 | +| Property | Type | Description | Required | |
| 116 | +|----------|------|-------------|----------| |
| 117 | +| name | string | The variable name of the entity. This value is not localizable. | Yes | |
| 118 | +| kind | string | A field name from the **ActionEntityKind** specifying the entity type. This value is not localizable. The allowed values are "None", "Document", "File", "Photo", "Text". | Yes | |
| 119 | + |
| 120 | +### InputCombination |
| 121 | + |
| 122 | +| Property | Type | Description | Required | |
| 123 | +|----------|------|-------------|----------| |
| 124 | +| inputs | string[] | A list of Input names for an action invocation. The list may be empty. | Yes | |
| 125 | +| description | string | Description for the action invocation. This value is localizable. | No | |
| 126 | +| where | string[] | One or more conditional statements determining the conditions under which the action applies. | No | |
| 127 | + |
| 128 | +### Invocation |
| 129 | + |
| 130 | +| Property | Type | Description | Required | |
| 131 | +|----------|------|-------------|----------| |
| 132 | +| type | string | The instantiation type for the action. The allowed values are "uri" and "com" | Yes | |
| 133 | +| uri | string | The absolute URI for launching the action. Entity usage can be included within the string. | Yes, for URI instantiated actions. | |
| 134 | +| clsid | string | The class ID for the COM class that implements **IActionProvider**. | Yes, for COM actions | |
| 135 | +| inputData | A list of name/value pairs specifying additional data for URI actions. | No. Only valid for URI actions. | |
| 136 | + |
| 137 | + |
| 138 | +## Related articles |
| 139 | + |
| 140 | + |
0 commit comments