function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Russel MendozaRussel Mendoza 

Flow Regex usage.

Hi Team,

I working on a flow right now and my code is basically to make sure that the word "INFINITI" is found it will only allow 2 characters otherwise it will allow anything lower than 2. The code below is working already.

IF(
({!make}) = "INFINITI",
LEN(Job_line_number)  = 2,
LEN(Job_line_number)  < 3
)

I want to insert a REGEX that will only allow alphanumeric characters only such as:

REGEX(Job_line_number,"[a-zA-Z0-9]+")

But for some reason when I insert this REGEX in the code above it gives me an error. Can you guys provide me some idea on how to make the regex work on the code above?

Any help is greatly appreciated.
Best Answer chosen by Russel Mendoza
Akhil AnilAkhil Anil
Hi Russel,

You need to add the REGEX function in your formula like this
 
IF(
({!make}) = "INFINITI",
AND(LEN(Job_line_number)  = 2,REGEX(Job_line_number,"[a-zA-Z0-9]+")),
AND(LEN(Job_line_number)  < 3,REGEX(Job_line_number,"[a-zA-Z0-9]+"))
)

Kindly mark it as an answer if that works !

All Answers

Akhil AnilAkhil Anil
Hi Russel,

You need to add the REGEX function in your formula like this
 
IF(
({!make}) = "INFINITI",
AND(LEN(Job_line_number)  = 2,REGEX(Job_line_number,"[a-zA-Z0-9]+")),
AND(LEN(Job_line_number)  < 3,REGEX(Job_line_number,"[a-zA-Z0-9]+"))
)

Kindly mark it as an answer if that works !
This was selected as the best answer
Russel MendozaRussel Mendoza
So that's what I'm missing. Thank you so much for your help.