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
Silkcutz01Silkcutz01 

Validations in Visual Workflow

To prevent my Flows failing in writing back to SFC objects I need to ensure some fundamental validations are taken care of:

 

  1. Field inputs do not exceed the maximum number of characters set within the SFC Object. 
  2. Email addresses are formatted correctly.

Without these validations in place the Flow fails when these conditions are not met.

 

I do not have any experience of creating regex validation rules so would be grateful for anyone's advice here.

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
RajaramRajaram
Validation rules in flow reuse salesforce formulas. so for things like as max characters you can use existing functions such as LEN.
For email address here is the salesforce formula you can use:

REGEX({!Email_Address},"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}")

Note that the screen input field here has the unique name Email_Address.

Hope this helps..