top of page

Add Custom Validation in Lightning Flows

Hi, #AwesomeAdmins! In past I got stuck with one requirement for flows. That was about adding validation for Postal Code in Address Component (Standard). But there is no way to add validation rule to that.


Want to learn quickly, watch out this video. Entire use case and solution is described!


Use Case: To add custom validation to postal code, to validate the length of zip code is 5.

Screen1

So let's see how I tackled this situation. I added a display text to the screen, just below to Address Component.


Then I created a Boolean variable (showZipCodeError) to control the visibility of this new Display component and a formula type variable to check the validation of postal code. This is how it looks like:



Now, it's time to check the output of our formula field (zipCodeValidationFormula) through a decision element. If it's true then we will assign result of formula variable to boolean variable (showZipCodeError).


Formula Validation Field




That, is how I tackled the situation. I would love to know, how you would have tackled this.


Thanks for your time.


860 views0 comments

Recent Posts

See All
bottom of page