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.

ree
Screen1

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

ree

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:

ree

ree

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).


ree
Formula Validation Field
ree


ree

ree

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


Thanks for your time.


Комментарии


Aviral Agrawal

Principal Technical Architect

Subscribe to get all the updates.

Thanks for submitting!

Aviral Agrawal

Mail: aviralsfdc@gmail.com

bottom of page