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
Itayb34Itayb34 

Validation on Choice

Hello

 

I've added a screen which the user can pick which license to create with choices (Trial / Production / Cloud), but I'd like to have validation on some options. For example: user with "Support" profile can't pick production license.

I can create a decision option and route to two different screens, but i'm wondering if I can add validation on a choice (so when a support user picks "production" choice, an error message is displayed - "you can't pick this kind of license").

 

 

Thanks

 

Itay

Best Answer chosen by Admin (Salesforce Developers) 
DarrellDDarrellD

Sure you can create that. So first I'm assuming that the choices aren't part of the user profiles in SalesForce? Flow respects those so obviously if person in SalesForce, for whatever reason, didn't have access to these choices then they won't in Flow either...for most part.

 

You can use a Decision after the selection to say "If User Profile X selected 'Production' then go here".  So you would need to make different decision elements in your Flow based on the user profile.  So this won't stop them from picking it, but will give them an error once they have. You can then just route them back to the selection screen to pick something else. Pretty much same thing validation rules already do since user can still pick the choice, then rule fires and gives them an error.

 

Darrell

All Answers

DarrellDDarrellD

Sure you can create that. So first I'm assuming that the choices aren't part of the user profiles in SalesForce? Flow respects those so obviously if person in SalesForce, for whatever reason, didn't have access to these choices then they won't in Flow either...for most part.

 

You can use a Decision after the selection to say "If User Profile X selected 'Production' then go here".  So you would need to make different decision elements in your Flow based on the user profile.  So this won't stop them from picking it, but will give them an error once they have. You can then just route them back to the selection screen to pick something else. Pretty much same thing validation rules already do since user can still pick the choice, then rule fires and gives them an error.

 

Darrell

This was selected as the best answer
Itayb34Itayb34

Thanks Darrel

Eventually I created a decision element based on profile, so if it's profile X - they see a certain screen, and if it's other profile, they see different screen.