Create a Next Best Action Employee App – Part 2
/1 Comment/in Flow, Next Best Action/by Janani NarayananSetup and Installation steps (View Part 1 for demo video and details on the building blocks)
STEP 1: Install package
- Install the NBA Employee app package and follow along
OR
- Clone repo from git: https://github.com/jnarayanan15/repo/tree/Employee_NextBestAction
STEP 2: Setup the environment
- Make sure all custom fields on the User object are accessible and visible in the page layouts
- Object Manager โUser โFields & Relationships
- Navigate to each of the fields below and follow the steps to Set Field Level Accessibility to Visible to all profiles
- Navigate to each of the fields below and follow the steps to Set Field Level Accessibility to Visible to all profiles
- Einstein HiPo Likelihood
- Next Shift Start Date
- Next Shift End Date
- Is People Manager
- Survey Taken
- Navigate to each of the fields below and follow the steps to Set Field Level Accessibility to Visible to all profiles
- Ensure that the fields are visible in the default page layout
- Go to object manager – User page layouts. Drag the custom fields to the Additional Information Section
- Repeat for Message layout โDrag the Category field appears in the detail page
STEP 3: Create Users of the app.
- User1
- First name Bessie
- Last Name Thomas
- use your email for email and
- give a username such as b.thomas@demo51.org
- In additional information
- Check Is People Manager
- Add dates for Next Shift Start and Next Shift End Dates
- Leave the Survey Taken column unchecked
- User2 (Important to use the same name as for the purpose of the demo , it is hard coded)
- First name Rosa
- Last Name Garcia
- use your email for email and
- give a username such as m.garcia@demo51.org
- In additional information
- Leave the Is people manager unchecked
- Leave the Survey Taken column unchecked
- Give a value >80% to simulate Einstein HiPo Likelihood
- Add dates for Next Shift Start and Next Shift End Dates
- Make sure to remember the username and also change the password. (You should receive an email on the registered email)
STEP 4: Assign permissions
- Go to users – permission set and enable both Goodmorning and Goodmorningsales permission for the user user(user user is the admin user for scratch orgs)
- Permission set โManage Assignmentsโ Add Assignmentsโ User, User (if scratch org or the relevant users) .
- Profilesโsystem adminโ change permissions to view object (Assuming both users are System Administrators. If not assign the following permission accordingly to the users created)
- custom app setting โcheck bright team management
STEP 5: Add Data to custom objects
- Go to SalesTacticalPlan object from the AppMenu (If it does not show – make sure the user permissions are set)
- Create a record with the details shown (EmployeeDailyTacticalPlan)
- Create the following records to the Recommendation object
- If you do not see any field visible on the recommendation object : Go to Recommendation object ManagerโPage LayoutโManage Assignment โEdit Assignment and assign recommendation layout to all users.
| Name | Description | Action Reference | Acceptance Label | Rejection Label | ||
| 1 | Priority Message: Tax Day | Tax day is in 6 weeks! Get more detail. | Tax_Flow | Accept | Reject | |
| 2 | Priority Message: Well Being Survey | Our records indicate that you have not taken the Well Being Survey. Please take a few minutes to complete it. | Well_Being_Survey_Flow | Accept | Reject | |
| 3 | Work.com Contact Risk Alert | Alert! You have recently come in contact with someone who has tested positive for COVID -19. Please contact the health center for more details. | Contact_Risk | Accept | Reject | |
| 4 | Return to Work Shift Days | Shift_Flow | Accept | Reject | ||
| 5 | Training Recommendation | Your manager has identified that you will benefit from the Great Salesforce Leaders training. Click to enroll. | Enrollment_Flow | Accept | Reject |
STEP 6: Set up the flow component to accept input for which messages and their respective priorities to be surfaced on the NBS Component
- Navigate to the Bright Team Mgmt App from the App Menand then user profile(click on the profile pic icon) and then edit page to bring up LAB. NOTE: If you click on user profile when on setup , you go to User setup not the profile page so make sure you are on the app when pulling it up
- Drag the Flow component and choose Manage Employee Tactics as shown below

Drag a flow component.Choose the manage tactical plan. activate it for the org default
- Go to the Bright Team Mgmt app and then user profile(click on the profile pic icon) and then edit page to bring up Lightning App Builder โ if clicking on user profile when on setup pulls up
Also set component visibility , add filter, Save and Activate.
- Go back to user profile and the flow component displays –
- Click Manage the team Priorities
[If the following error message displays then do this additional step below]
This step maybe required on a non-scratch org - go to Setup - My Domain โRegister a domain โLogin โDeploy to users.
Once done go back to UserProfile
- Click Manage the team Priorities
Order priorities(these are passed in from the flow) - these are all messages that are available. Once ordered - it gets saved on the EmployeeDailyTacticalPlan record as shown below
STEP 7: Set up the NBA component (This is another flow component with a custom LWC -NOT THE STANDARD NBA COMPONENT)
We use a custom component here to show the modularity of the strategy builder. This demo can also be built with the standard NBA component and that is not covered here.
- Navigate to the user profile page again and edit page.
- Add another flow component (which acts as the NBA component )
- Choose โDemoFlow_GetRecommendationsWithFlowActionโ Flow
- Click on the Pass Record id
- Enter the strategy name- EmployeeTacticalStrategy (In the NBA component record id is passed automatically)

Set component visibility so it is viewed by the second user
STEP 8: Login and test the component
- Login to the first user page : Bessie smith – Set the priorities. (If already covered in the steps above, login as the second user)
- Now login to the second user page : See that the recommendations are displayed


Create A Next Best Action Employee App- Part 1
/1 Comment/in Flow, Next Best Action/by Janani NarayananEmployee experience is the new HR superpower. Customer experience is no longer only for customers, with the Salesforce Platform you can not only seamlessly create amazing digital experiences for employees but also deliver them personalized and optimized. Especially in light of the new โwork anywhereโ normal that fused home and work life, digital employee experience plays a key role in not just productivity but also employee motivation.
On this employee experienced focussed app, Einstein NBA can be leveraged to deliver
- Education and event participation opportunities
- Personalized communication
- Well being and motivation opportunities
and much more. Powered with the insights from Einstein prediction builder – NBA combines data, business rules and AI to provide relevant and real time individualized recommendations.
Note: Prediction builder is not integrated in the app below but simulated with prediction scores.
Use Lightning flows with NBA
This app also showcases how Lightning flows can be used in conjunction with Next Best Action. There are numerous applications of how flow and NBA can be integrated into apps for powerful outcomes such as the one in this example. The example also shows a custom LWC component to display Recommendations and not the standard display component -this illustrates the modularity of the strategy builder and how it can be used with a custom component because it is exposed as a service.
A great way to combine the power of Apex with business user configuration
This sample application uses a sophisticated pattern to provide team managers with a simple flow that they can use for prioritization, while enabling IT to add or subtract recommendation tactics behind the scenes. This is a powerful way to address the desire of customers to mix backend power with business user configuration.
The individual tactics are modeled as Apex classes. The same example can be extended for several use cases of how system integrators can use Next Best Action to provide increased value by making use of Apex to create tooling that team managers can use to cater to the specific use case.
Building blocks of the app
(View setup and installation steps in Part-2 of the blog)




Jen Lee on Using Scheduled Flows to Deactivate Inactive Users
/0 Comments/in Flow/by Alex EdelsteinVery detailed and effective blog post. Check it Out!

From Vibhor Goel: New Blog Posts Showing Flow Technique for Cloning, Before Save Triggers, and File Uploads
/5 Comments/in Flow/by Alex EdelsteinIntroducing Flow Buttons, Courtesy of Ryan Cox
/9 Comments/in Flow/by Alex EdelsteinRyan Cox is a Technical Architect here at Salesforce, and he has built some very sweet Flow functionality. The FlowButton is a button that launches Flows. Simple concept, but no one has ever really shown what you can do with this.
Let’s start with what you can do when you put a FlowButton on a Lightning Page:
Windowshade Flows!
You can already add Flows to Lightning Pages either via the Flow page component or a Quick Action button. Both are powerful but both also have drawbacks. The Flow component takes up a lot of space on the screen and you can’t easily turn it on or off. The Quick Action buttons take up only a little space, but they pop up as modals in a form factor that often isn’t quite the right size.
What Ryan figured out is one of those things that seems incredibly obvious in hindsight: you could have the best of both words if you build a lightning page component that has two modes. It starts out as a small button that looks like this:

but when you click the button, it expands like a window shade and becomes an inline Flow:

If you want, you can have the flow pop up as a modal. You also get some powerful css-based formatting options for the button’s appearance:

You can insert FlowButtons into lightning components, but sadly only aura components. the lightning:flow runtime component is only available in aura, and lwc components can’t embed aura components (although I’d love to see someone experiment with doing this via an iframe).
<c:RC_FlowButton buttonLabel="Submit"
variant="BRAND"
flowToLaunch="Create_Contact"
showFlowInModal="true"
/>
Controlling Flow Screen Navigation
Like the existing components Custom Footer Button and Navigation Button, FlowButton can control the movement of flow screens, triggering a Next or Previous transition:

You can have a set of these buttons that navigate to different parts of your Flow. Set this up by having the buttons update a flow variable, and then use that variable in a decision element:


Improved Dynamic Subflow Launching
Subflows are a powerful way to increase your reuse, but they have a major weakness in that the Subflow element requires the name of the subflow to be chosen at the time the flow is built, instead of when the flow is run.
Last year, UnofficialSF published a method for dynamically launching subflows. FlowButton improves on that method in two useful ways:
- The subflow will be launched within the same screen as the parent flow
- The parent flow only continues after the subflow has completed.
This creates a seamless experience for the user. To configure the button to be used in this mode, configure it to hide the button, automatically launch a flow on init, and progress the parent flow when the subflow completes.

If you want the master flow to transition after the subflow completes, set ‘Do Flow Action When Subflow Completes’ to true.
Example Content
There is available demo content in the full package, which is available here. The install link at the bottom of the page will only install the FlowButton component itself. (Note that to see the below example content, you’ll need to go into your profile and make visible both the Flow Components App and the Test-Flow Button Custom Tab.)

This screen shows some of the styling options:

If the button is placed on a record detail page, the recordId will be passed to the Flow.


Two example flows for dynamically launching subflows are the Flow Router and Case Status Router.



The Case Status Router flow is configured on the Case record page.



Other Examples
Some examples of how Iโve used this component in demos and VTO projects.
On a Community page


On Lightning pages

In custom Lightning components on a Flow screen

In custom Lightning components within Lightning pages
This shows a modification of the Salesforce Labs Trekkr app where the steps of an onboarding trail are completed by launching a flow. More details on this are here: Trekkr: launch flows for steps


Install
Version 1.0 Unmanaged (component only)
Version 1.0 Unmanaged (full examples)
Source
New Automation Tool Comparison Guides
/1 Comment/in Flow/by Alex EdelsteinTwo very substantial new guides have just been published. They are the product of a huge internal effort spearheaded by Salesforce Flow Product Managers Sam Reynard and Tim Peng. Check it Out!
Introduction to the Architect’s Guide

Gidi Abramovich on Adding Validation to Standard Picklists using Flow and the new Record-Changed Trigger
/0 Comments/in Flow/by Alex EdelsteinSummer ’20 provides a new trigger: Start your Flow when a record is created or changed, just like Process Builder. Gidi’s post shows how you can use this to prevent unexpected values from being set on picklist fields.

Note that Gidi’s solution features a workaround that allows the Flow to use ‘IsChanged’ functionality:

Sneaking Dynamic Data into Email Templates with Send Rich Email
/2 Comments/in Flow/by Alex EdelsteinAs discussed in the Email Templates section of the Send Rich Email action, Salesforce Lightning Email Templates have an ability to merge data in dynamically, but it’s limited. You can only merge in fields from a core set of supported Standard records: Lead, Contact, User:


What if you want to merge in additional dynamic data? You can do it using Flow.
The basic idea is that you create one or more custom fields on Lead, Contact, or User to serve as temporary holding pens for dynamic data. Then in the same Flow that you use to send the email, you update the record with your dynamic data. After you send the email, you can choose to erase the data from the custom field.
Example: you want to add a Price quote to an Email that’s sent to Contacts. You add a custom field to Contact. You could be specific and call it PriceQuote__c but we’ll be more general purpose and call it FlowMergeField1__c so we can use it for different purposes. Over in Lightning Email Template, add the field to your email body or subject:


In the Flow, take the contact record and do an Update Records setting the value of FlowMergeField1__c to the price you want inserted in the email.
You then need to make sure that the database commits your change before you call Send Email. Any Screen will cause a commit, so you could insert a screen that says “Click next to send”, and it would commit your update. You can eliminate that step with the Commit Transaction action if you’re using a Screen flow, and with a Pause element set to a zero time duration if you’re using an Autolaunched flow. Without this step, it still might work some of the time, but do this for reliability.
Then call your Send Rich Email action, passing it the ID of the template.
New Guide on Automation Tools
/1 Comment/in Flow/by Alex EdelsteinMichael Schmidt-Korth from Salesforce has published a nice updated comparison, complete with updated polar charts. Check it Out!

- Create a Next Best Action Employee App – Part 2June 30, 2020 - 3:20 pm
- Create A Next Best Action Employee App- Part 1June 30, 2020 - 3:19 pm
- Adding Lightning Web Components to Flow ScreensOctober 21, 2019 - 7:45 am
- The Top 10 Things You Want to Know About the New Flow B...February 11, 2019 - 5:36 pm
- Salesforce Einstein Next Best Action “Getting Started”...February 3, 2019 - 2:34 am
- Send Rich Email (Send HTML Email Action)September 12, 2019 - 4:15 pm
- Quick Choice – Improved Picklists and Radio Buttons...December 25, 2019 - 12:57 pm
- Collection Processors for Flow (Sort, Filter, Find, Join,...December 17, 2019 - 12:18 am
- Send Richer Email with the ‘Send Better Email’...August 11, 2020 - 10:23 am
- Create a Next Best Action Employee App – Part 2June 30, 2020 - 3:20 pm
- Create A Next Best Action Employee App- Part 1June 30, 2020 - 3:19 pm
- Adding Lightning Web Components to Flow ScreensOctober 21, 2019 - 7:45 am
- The Top 10 Things You Want to Know About the New Flow B...February 11, 2019 - 5:36 pm
- Salesforce Einstein Next Best Action “Getting Started”...February 3, 2019 - 2:34 am
- Using Flow, Prompt Builder, and Multimodal AI to Validate...May 19, 2026 - 12:35 pm
- Minor update to Datatable (v4.3.7)May 15, 2026 - 2:35 pm
- New String Normalizer Apex ActionApril 15, 2026 - 11:37 am
- From: Sravya Yellapragada – Unlocking Payments Processing...March 12, 2026 - 6:59 am
- […] you need to parse it somehow. Since there is no...March 28, 2026 - 11:32 am by How to Process Images and PDFs in Flow Using Prompt Templates – studoi.com
- […] you need to parse it somehow. Since there is no...March 28, 2026 - 12:53 am by How to Process Images and PDFs in Flow Using Prompt Templates - Salesforce Time
- […] first is more complex and can solve almost anything,...March 24, 2026 - 5:19 am by Can you calculate follow-up time for us? - Blog Martina Humpolce
- […] that case, you can use a local action that doesn’t...March 7, 2026 - 9:09 am by How to Fix MIXED_DML_OPERATION Error in Salesforce Flow – studoi.com


