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
mlucmluc 

Validating a Text Field in Flow

In a Flow, I have a text box field called Last Name (Last_Name). What I need is to make sure that neither the words "Unknown" or "Delete" are accepted as values in that text field. If either is entered and the next button is clicked, an error will display above the text box saying something like "You must enter a valid last name before proceeding." 

 

I'm thinking perhaps a regular expression could accomplish this. I would like to make the validation case-insensitive. Any help is greatly appreciated.

Best Answer chosen by Admin (Salesforce Developers) 
RajaramRajaram
You dont need regular expressions for this. Remember that the validation rule for the input field is the classic salesforce formula syntax. So, just using the CONTAINS function should suffice.

More info on the CONTAINS function: http://na1.salesforce.com/help/doc/en/customize_functions_a_h.htm#CONTAINS


Of course, if you are looking for handling mixed case then the best way is to use the UPPER function along with contains.

So something like CONTAINS(UPPER({!input}), 'UNKNOWN')

Hope this helps..