Skip to content

Commit 97830de

Browse files
authored
docs: add resourceType property to support storage picker (#1261)
Docs of new input schema property `resourceType`
1 parent 40cb7e8 commit 97830de

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
40.2 KB
Loading
76.5 KB
Loading
32.3 KB
Loading

sources/platform/actors/development/actor_definition/input_schema/specification.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,56 @@ Editor type `select` allows the user to pick items from a select, providing mult
409409
```
410410

411411
To correctly define options for multiselect, you need to define the `items` property and then provide values and (optionally) labels in `enum` and `enumTitles` properties.
412+
413+
### Resource type
414+
415+
Resource type identifies what kind of Apify Platform object is referred to in the input field. For example, the Key-value store resource type can be referred to using a string ID.
416+
Currently, it supports storage resources only, allowing the reference of a Dataset, Key-Value Store or Request Queue.
417+
418+
For Actor developers, the resource input value is a string representing the storage ID.
419+
The type of the property is either `string` or `array`. In case of `array` (for multiple resources) the return value is an array of IDs.
420+
In the user interface, a picker is provided for easy selection, where users can search and choose from their own storages or those they have access to.
421+
422+
Example of a Dataset input:
423+
424+
```json
425+
{
426+
"title": "Dataset",
427+
"type": "string",
428+
"description": "Select a dataset",
429+
"resourceType": "dataset"
430+
}
431+
```
432+
433+
Rendered input:
434+
435+
![Apify Actor input schema dataset](./images/input-schema-dataset.png)
436+
437+
The returned value is resource reference, in this example it's the dataset ID as can be seen in the JSON tab:
438+
439+
![Apify Actor input schema dataset](./images/input-schema-dataset-json.png)
440+
441+
Example of multiple datasets input:
442+
443+
```json
444+
{
445+
"title": "Datasets",
446+
"type": "array",
447+
"description": "Select multiple datasets",
448+
"resourceType": "dataset"
449+
}
450+
```
451+
452+
Rendered input:
453+
454+
![Apify Actor input schema datasets](./images/input-schema-datasets.png)
455+
456+
Properties:
457+
458+
| Property | Value | Required | Description |
459+
|----------------|-----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------|
460+
| `type` | One of <ul><li>`string`</li><li>`array`</li></ul> | Yes | Specifies the type of input - string for single value or array for multiple values |
461+
| `editor` | One of <ul><li>`resourcePicker`</li><li>`hidden`</li></ul> | No | Visual editor used for <br/>the input field. Defaults to `resourcePicker`. |
462+
| `resourceType` | One of <ul><li>`dataset`</li><li>`keyValueStore`</li><li>`requestQueue`</li></ul> | Yes | Type of Apify Platform resource |
463+
| `minItems` | Integer | No | Minimum number of items the array can contain. Only for `type: array` |
464+
| `maxItems` | Integer | No | Maximum number of items the array can contain. Only for `type: array` |

0 commit comments

Comments
 (0)