/actions/{action_id}/inputs
endpoint:
invalidates_input_fields
field signifies whether the input fields should
be refetched from /inputs
when the value of the given field is changed. A real-world example
of when this might be required is for spreadsheet apps. When adding a new row to
a sheet, the first input field allows the user to select the relevant sheet and,
once that is selected, more input fields become available (one for each column
in the selected sheet). If the user changes the sheet, then the input fields
must be refetched.
When making a request to refetch the input fields, make sure to include all the
fields that have been populated so far:
spreadsheet
, we should refetch /inputs
and pass this new value to reload all fields.
If worksheet
is modified, once again we’d refetch /inputs
and reload the non-dependant fields.
This is because both spreadsheet
and worksheet
have invalidates_input_fields
field set to true
.
/inputs
should be refetched
if any of the dependent fields are changed. This is represented via the depends_on
array field, which has strings of field IDs in
it. Continuing with the spreadsheet example, the worksheet
field depends on
the spreadsheet
field. That is, if the user changes which spreadsheet they are
working in, the value of the worksheet field must be cleared (and /inputs
refetched)---as the set of
inputs available for the action will now be different.
The sequencing of inputs can be complex for certain actions, this flow demonstrates how to present these inputs to users.
value_type
key indicates what type of user data is accepted for a given field.
Per the schema, the options for value_type
are: STRING
, NUMBER
, INTEGER
, BOOLEAN
, ARRAY
, and OBJECT
.
The following variants warrant additional consideration:
Array fields
items
key will be defined for arrays, and it will contain a key type
with the
value type of the array items.This input field:Object fields
Boolean fields
true
or false
, their actual values can
change depending on the specific action. For this reason boolean values are paired with a format
of SELECT
and options should be fetched from /choices
. See choices for more information.
This input field:/choices
;id
of the selection. See choices for more information.format
key indicates how to present a given input field to the user, per the schema.
Its options are: DATETIME
, MULTILINE
, PASSWORD
, CODE
, READONLY
, FILE
, SELECT
. Additional information on
how these fields are processed by Zapier can be found in our help docs.
The following variants warrant additional consideration:
Readonly fields
description
field contains the text to be presented.File fields
Select fields
/choices
to fetch the choices available for
that input. See choices for more information.format
key is equal to SELECT
, the /choices
endpoint returns a list of options from which the user should select.
Continuing the spreadsheet example, the first input field is (spreadsheet
) which is
a string
type. The format
is SELECT
, which implies this field has a set of
choices for the user to select from (which would normally be rendered as a
dropdown menu in the UI).
To fetch these, use the /actions/{action_id}/inputs/{input_id}/choices
endpoint:
id
of the selected choice for the desired input.
/actions/{action_id}/outputs
endpoint: