Flow Designer - If condition using regex or similar expressions

Balaji Jagannat
Kilo Guru

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. 

 

2 REPLIES 2

Community Alums
Not applicable

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

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