(void): void
(blockId: string): void
(blockIds: string[]): void
The Validate
action is used to validate a users input, usually before information is inserted into a database using a request.
It is used in conjunction with the required
and validate
fields on input blocks. If the validation fails, the Validate
action will fail, and this will stop the execution of actions that are defined after it.
The first time a Validate
action is called, validation error are shown to the user. The Reset
action resets this.
Validate only validates the input blocks that are inside the context it is called from. Therefore, if you use two contexts to separate two forms, only the one form will be validated.
Parameters
void
The Validate
action validates all blocks in the context
if called without params.
string
A blockId of the block to validate.
string[]
An array of blockIds of the blocks to validate.
Examples
Validate all inputs in the context:
- id: validate
type: Validate
Validate a single input:
- id: validate_one
type: Validate
params: my_text_input
Validate a list of inputs:
- id: validate_one
type: Validate
params:
- my_text_input_1
- my_text_input_2