validate against whitelist
This block is part of the value group and was last modified in core v14.0.3.
validate against whitelist v14.0.3 Matches the input against a whitelist by string representation and returns the matching whitelist entry (in its original type), or the fallback when nothing matches
- value required
valueValue to be validated
- allowed values required
arrayArray of allowed values for exact matching
- fallback
valueFallback value in-case no safe values found
- value
valueReturns a guaranteed-safe value
Compares unsafe_value against each safe_array element by STRING representation and outputs the matching array ELEMENT (its original type), not the input. No match -- or a match whose string form is empty -- outputs fallback_value, or the FIRST array element when fallback_value is empty or unwired. An empty or missing safe_array emits NO output at all.
safe values |
whitelist |
A typical wiring for validate against whitelist: array with values feeds the safe_array pin; value feeds the unsafe_value pin; the value out pin feeds ==.
Commonly used with
In production blueprints, this block is most often wired together with:
- array with values: feeds into this block. Creates a new array of given values.
- get fields: feeds into this block. Gets the selected fields from the given object.
- set fields: this block feeds into it. Generates an array of mutations based on the given filled fields.
- value: feeds into this block. Simply returns the provided value.
- ==: this block feeds into it. returns true if the two values are equal.
- new object: this block feeds into it. Builds a new object filled with the given fields.
Version history
Introduced in v14.0.3.
Back to
value Return to the main group to view all sub-groups Back to value Return to the group to view all blocks within this group 