How to validate a range in my flow form using product metadata?
This article will guide you in validating a field based on the value from a product metadata in your flow form.
In this example, the field is valid between weightMin and weightMax
Create the first valid range by:
(data["weight"]>=(jobmeta["weightMin"]))&&(data["weight"]<=(jobmeta["weightMax"]))Step 1 - Dragging in the field from the form layout and drop anywhere in the grey space
Step 3 - Drag 'Product Data' on the '0' to replace. Click 'ratedSpeed' and select the product data e.g. weightMin

Step 4 - Drag in the 'AND' operator and drop after the parentheses
Step 5 - Dragging in the field from the form layout and replace the '0'
Step 6 - Drag in the 'less than' symbol ≤ and drop it inside the parentheses

Step 7 - Drag 'Product Data' on the '0' to replace. Click 'ratedSpeed' and select the product data e.g. weightMax
Step 8 - Click on the 'Valid' word
Step 9 - Set up the Form Status, Colour and add a message if needed.
Note: The Error status will not allow the user to submit the form until the field is valid.
Step 10 - Create the invalid rule by dragging the value into the dotted line
Step 11 - Enter the rule 1==1 in the white area. This code invalidates everything outside of the valid range.
Step 12 - Click the 'valid' word and set the Form Status to 'invalid', select a colour and add a message if needed.