Flow Designer - If condition using regex or similar expressions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 09:17 AM
HI team -
Within a "IF" logic, are there options to use string compare using regex or any similar options. Right now, I could see only 'is', 'isnot', 'contains' and 'doe not contains'.
Example: After doing a "look up record", I would like to run a regex compare on a specific field from the lookup record. Based on the condition result, would like to decide next steps.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2020 01:01 AM
Hi Balaji,
You can use the match() method for comparing your string to a regex. Example:
if(!(yourString.match(/[a-zA-Z0-9]/))) //this regex will check only alphabets and numbers
{
//your code
}
Here is a link for more reference:
https://www.w3schools.com/jsref/jsref_match.asp
Please mark as correct if this solves your query or helpful based on the impact.
Thanks,
Debopriya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 03:22 AM
I was looking for the same thing. A simple If step in a flow, and I need to perform a regex on the returned value, all I see is "is, is not, contains, does not contains". I cannot see if contains the phrase I am checking for and a 16 character number at the end
I see no way to do a regex or anything like that.
Your example is yet another code step - which makes me think, why the hell am I bothering with flow when 90% of what I am putting into this flow is a script. Would be far easier for me to write a single script Include and call that and get the answer I want instead of all this faffing with Flow