Skip to content

Salesforce Flows

Flow Haxx – 3 Quick Tips for Optimizing Salesforce Screen Flows

Published on June 13, 2023 · 4 min read · Alexander Declan Nikolai

made with AI

Flows have been part of Salesforce for a while now, but there are still plenty of tips and tricks you can use to take your automations to the next level. In this article, we'll show you a few useful hacks to make your screen flows more efficient and user-friendly. So get ready to level up your flow skills, and let's get started!

Tip 1: Screen Flow Next Level – Creating a Modern Layout

We're all familiar with screen flows in Salesforce. But if you also feel that your screen flows could look a bit snazzier, the following tip is exactly right for you.

First, we design the layout of the individual screens. Using the “Section” element, we can display several fields side by side. This saves space and simplifies data entry for the user. To show the user which step of the guided flow they're currently on, you can install the “Dynamic Flow Progress” component from the AppExchange marketplace. This component offers six different display options.

The component then needs to be placed on every relevant screen element. We now define the screens whose progress should be displayed — in this example “Personal”, “Business” and “Public” — though it doesn't matter what the screens are actually called.

Finally, we define the screen we're currently on. In the screen where personal data is collected, we enter “Personal” under “Current Step”. In the “Indicator Type” field, we specify which display type should be shown — in this case, “Horizontal”.

And just like that, users can find their way around the flow more easily, and the screens look more modern and dynamic than those built with the standard components. We can also define a percentage for each screen, which is displayed graphically in the “Ring” and “Bar” display types.

Tip 2: Bypass Validation Rules with a Flow in 4 Steps

Picture this: the Lead object has a special status that users shouldn't be able to set directly. So there's a validation rule that prevents it.

The status should only be reachable via a screen flow, after entering some additional data. But if we now build a screen flow, it will fail, because the validation rule blocks the status change altogether – regardless of whether a user or a flow is trying to change it.

To get around this problem, we can put together a workaround.

1. We create a new Date/Time field on the relevant object called “AutomationByPassDateTime” or similar.

2. Next, we create a checkbox formula field called “IsAutomationByPassed?” with the following formula: “ AutomationBypassDateTime__c > NOW() – 0.00005787037 /*Five Seconds*/”.

3. After that, the validation rule needs to be extended with the condition “IsAutomationbypassed” = “false”.

4. In the last step, we update the Date/Time field to NOW in the flow that's meant to bypass the validation rule, using the formula “NOW()”.

What have we achieved with this?

  • Thanks to the new condition in the validation rule, we check on every status change whether the validation rule should be bypassed.
  • The rule is bypassed as soon as the “IsValidationByPassed” checkbox is set to “true”.
  • The checkbox is true when the time the flow writes into the “AutomationBypassDateTime” DateTime field is later than “Now – 5 seconds”. This creates a 5-second window in which the checkbox is “true” and the status can be changed.
  • In that particular project, we also ran the screen flow in “Run as System” context, since users shouldn't have edit permission on the object and were meant to make data changes exclusively through the screen flow.

This solution was originally devised by Parker Edelmann.

Tip 3: A Screen Flow Button in a Salesforce Experience Cloud Site

Want to add an onboarding screen flow to your partner experience via a button? With our tips, that's a piece of cake.

To launch the screen flow via a button, we first need to install the “Launch Flow in Modal” component from the AppExchange marketplace. After that, the custom component “Launch Flow in Modal” is available for selection on the experience. This lets us attach the flow to the button and style the button however we like.

We can now launch the screen flow via the button:

The data entered is then saved from the community into the object defined in the flow, and can subsequently be analyzed and processed further.

That's it for Flow Haxx! We hope you picked up a few useful tips and tricks to make your flows even better. Have fun trying out and optimizing your flows! And remember: with a bit of creativity and a pinch of humor, you can turn your flows into real masterpieces.

If you're still using Process Builder and need help migrating to Flow, click the button below to save 10%.

Originally published on blog.factory42.com