Four Tips for Leveraging Custom Errors in Flows


In Salesforce flows, the custom error element allows you to define and display custom error messages when a flow encounters an issue or when certain conditions are met. This feature enhances user experience and error handling by providing more specific and meaningful feedback than generic or system error messages.
For example, if a user attempts to submit a form without filling out all required fields, instead of being met with a standard, impersonal error, they are greeted with a custom message thoughtfully designed to point out the missing information. This level of specificity not only aids in quickly resolving the issue at hand but also contributes to a learning environment where users can better understand the system’s requirements through direct, relevant feedback.
This approach to error handling not only streamlines the problem-solving process but also significantly enhances the user experience by making interactions with the Salesforce platform more intuitive, less frustrating, and decidedly more engaging.
This recent addition to the flow builder offers specific functionality attributes resulting in UI risks that must be managed delicately.
Here are four tips to follow when leveraging the custom error elements in flow:
1️⃣ Insert the Flow Label and the System Fault Message
Insert the flow label into your record-triggered flow custom error message, or use a unique code to help you track where the message comes from. When appropriate, include the $Flow.FaultMessage as well.
2️⃣ Set The Most Effective Placement
You choose where the message is displayed in the Custom Error Element in record-triggered flows. It can be displayed at the bottom of the page in a list along with other messages or next to a field of your choice.
3️⃣ Avoid Using Custom Errors With Stage/Status
When a path component is present on the record page layout, a change of stage or status using this component produces an error message at the top of the screen that disappears quickly. The user won’t be able to read that message.
4️⃣ Validation Rule, Before Save and After Save Custom Errors Appear in Batches
If your entry triggers multiple messages and you have messages in multiple categories, you don’t see them all until you clear one batch. This UI behavior can be confusing. Build messages in one category only.
While custom error functionality can be used to block user transactions, other options should be exhausted before admins resort to this approach. Sharing and security settings, profiles, permission sets, and validations can provide the same or better UI when restricting user actions.
How do you leverage the custom error message component in flows? Have you come up with cool use cases? Please comment below!
Explore related content:

4 Comments