Skip to content

Commit bc1d192

Browse files
committed
Updating the action json with the entity reference and a section on where clauses
1 parent de62eea commit bc1d192

File tree

1 file changed

+104
-1
lines changed

1 file changed

+104
-1
lines changed

hub/apps/develop/action-framework/action-json.md

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The tables below describe the properties of the action definition JSON file.
115115
| Property | Type | Description | Required |
116116
|----------|------|-------------|----------|
117117
| 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 |
118+
| kind | string | A field name from the **ActionEntityKind** enumeration specifying the entity type. This value is not localizable. The allowed values are "None", "Document", "File", "Photo", "Text". | Yes |
119119

120120
### InputCombination
121121

@@ -135,6 +135,109 @@ The tables below describe the properties of the action definition JSON file.
135135
| inputData | A list of name/value pairs specifying additional data for URI actions. | No. Only valid for URI actions. |
136136

137137

138+
## ActionEntityKind enumeration
139+
140+
The **ActionEntityKind** enumeration specifies the types of entities that are supported by the Action Framework. In the context of a JSON action definition, the entity kinds are string literals that are case-sensitive.
141+
142+
| Entity kind string | Description |
143+
|-------|------------|-------------|
144+
| "File" | Includes all file types that are not supported by photo or document entity types. |
145+
| "Photo" | Image file types. Supported image file extensions are ".jpg", ".jpeg", and ".png" |
146+
| "Document" | Document file types. Supported document file extensions are ".doc", ".docx", ".pdf", ".txt" |
147+
148+
## Entity properties
149+
150+
Each entity type supports one or more properties that provide instance data for the entity. Entity property names are case sensitive.
151+
152+
The following example illustrates how entities are referenced in the query string for actions that are launched via URI activation:
153+
154+
`...?param1=${entityName.property1}&param2=${entityName.property2}`
155+
156+
For information on using entity properties to create conditional sections in the action definition JSON, see [Where clauses](#where-clauses).
157+
158+
### File entity properties
159+
160+
| Property | Type | Description |
161+
|----------|------|-------------|
162+
| "FileName" | string | The name of the file. |
163+
| "Path" | string | The path of the file. |
164+
| "Extension" | string | The extension of the file. |
165+
166+
### Document entity properties
167+
168+
The *Document* entity supports the same properties as *File*.
169+
170+
### Photo entity properties
171+
172+
The *Photo* entity supports all of the properties of *File* in addition to the following properties.
173+
174+
| Property | Type | Description |
175+
|----------|------|-------------|
176+
| "IsTemporaryPath" | boolean | A value specifying whether the photo is stored in a temporary path. For example, this property is true for photos that are stored in memory from a bitmap, not stored permanently in a file. |
177+
178+
### Text entity properties
179+
180+
| Property | Type | Description |
181+
|----------|------|-------------|
182+
| "Text" | string | The full text. |
183+
| "TextFormat" | ActionEntityTextFormat | The format of the text. |
184+
| "ShortText" | string | A shortened version of the text, suitable for UI display. |
185+
| "Title" | string | The title of the text. |
186+
| "Description" | string | A description of the text. |
187+
| "Length" | double | The length of the text in characters. |
188+
| "WordCount" | double | The number of words in the text. |
189+
190+
## ActionEntityKind enumeration
191+
192+
The **ActionEntityTextFormat** enumeration specifies the types text formatting recognized by the "Text.TextFormat" entity property.
193+
194+
| Entity kind string | Description |
195+
|-------|------------|-------------|
196+
| "Plain" | Plain text. |
197+
| "Markdown" | Markdown formatted text. |
198+
199+
## Where clauses
200+
201+
The action definition JSON format supports *where* clauses that can be used to implement conditional logic, such as specifying that an action should be invoked only when an entity property has a specified value.
202+
203+
The following operators can be used with *where* clauses.
204+
205+
| Operator | Description |
206+
|----------|-------------|
207+
| == | Equality |
208+
| ~= | Case-insensitive equality |
209+
| != | Inequality |
210+
| < | Less than |
211+
| <= | Less than or equal to |
212+
| > | Greater than |
213+
| >= | Greater than or equal to |
214+
| \|\| | Logical OR |
215+
| && | Logical AND |
216+
217+
*Where* clauses use the following format:
218+
219+
```json
220+
"where": [
221+
"${<property_accessor>} <operator> <value>"
222+
]
223+
```
224+
225+
The following example shows a *where* clause that evaluates to true if a **File** entity has the file extension ".txt".
226+
227+
```json
228+
"where": [
229+
"${File.Extension} ~= \".txt\""
230+
]
231+
```
232+
233+
Multiple *where* clauses can be combined using the logical AND and logical OR operators.
234+
235+
```json
236+
where": [
237+
"${File.Extension} ~= \".txt\" || ${File.Extension} ~= \".md\""
238+
]
239+
```
240+
138241
## Related articles
139242

140243

0 commit comments

Comments
 (0)