Overview
The Command Validation command provides functionality for:- Validating that required strings exist in the data (
includemode) - Validating that specific strings are absent from the data (
excludemode) - Combining multiple values with
ORlogic (any match required) orANDlogic (all matches required)
Command Type
Command Type ID: 1Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| values | Array of string | An array of strings to check for in the data | Yes |
| matchMode | string | Whether to validate that values are included in or excluded from the data. Possible values: "include", "exclude". Defaults to "include" | Yes |
| combineLogic | string | How multiple values are combined: "or" requires any match, "and" requires all matches. Defaults to "or" | Yes |
matchMode Values
| Value | Description |
|---|---|
"include" | Throws an error if none of the values are found in the data |
"exclude" | Throws an error if any of the values are found in the data |
combineLogic Values
| Value | Description |
|---|---|
"or" | Condition is met if any of the configured values match |
"and" | Condition is met only if all of the configured values match |
Usage Examples
Validate String is Present (include / or)
Validate All Required Strings Exist (include / and)
Validate No Error Strings are Present (exclude / or)
Validate None of Multiple Strings are Present (exclude / and)
Common Use Cases
- Response Guard: Ensure a success indicator is present in an HTTP or WebSocket response before processing
- Error Detection: Throw early if an error string is found in the data
- Completeness Check: Verify all required field names are present in the raw data
- Blocklist Check: Reject data that contains any forbidden string
Related Commands
- JSON Parse - Parse data before validating
- Http Request - Validate HTTP response content
- Filter - Filter data by field values after validation