In Flows, you can validate string patterns using regex (regular expressions), but through JSONata expressions, not directly in conditionals.
This guide walks you through how to use regex in a Set Variable step using a JSONata expression, test it, and use the result in a follow-up conditional step.
Step-by-Step: Matching Regex in Flows
Step 1: Add a Set Variable Step
In your flow, click Add Step and choose Set variables.
Add a new variable. Name it appropriately (e.g., phone_regex).
Step 2: Select the Input Variable to Evaluate
In the Set Variable step, select the value as an variable which points to the actual input value you are validating.
Then, click to select the variable that holds the input you want to test.
A modal will open with all the possibile variable modifiers available to you. Select the edit JSONata expression.
Step 3: Use a JSONata Expression for Regex
In the JSONata editor modal, paste your expression. For example, to validate a phone number: