Skip to main content

#Flow169 discussing

I recently implemented a Salesforce automation to simplify how we handle duplicate Prospect and Customer Accounts. Sharing the approach in case it helps other Salesforce Admins facing a similar scenario.

🔹 The Business Problem

In our process:

  • Sellers manually create Prospect Accounts in Salesforce.
  • Once a prospect becomes a customer, the Customer Account is automatically created in Salesforce through an integration with another system.
  • The original Prospect Account remains in Salesforce.
  • This can result in a Prospect Account and Customer Account representing the same company i.e, duplicate accounts.

Previously, sellers had to identify these duplicates and submit a ticket manually so an Admin could merge the records.

🔹 The Solution

I built an automation that follows this process:

Duplicate identified → Prospect Account flagged → Duplicate Account button + bell notification displayed → Seller clicks the button → Email sent to Service/Admin team → Admin reviews and merges the accounts

🔹 Implementation Steps

1. Create the Matching Rule and Duplicate Rule : A Matching Rule and Duplicate Rule to identify a Prospect Account and Customer Account as duplicates based on our internally defined matching criteria.

2. Create a Record-Triggered Flow: Record-Triggered Flow that runs when a Duplicate Record Set is created or updated.

Within the Flow:

  • Get Duplicate Record Items: Retrieve the Duplicate Record Items associated with the Duplicate Record Set.
  • Loop Through Duplicate Record Items: Loop through the Duplicate Record Items and assign the relevant Account/Company Name to a Flow variable.
  • Find the Matching Account: After the loop, use Get Records on the Account object to find the corresponding Account based on the Account/Company Name stored in the Flow variable.
  • Flag the Prospect Account: When the matching Account is found, update the Prospect Account and set our custom Duplicate Account checkbox field to True.

3. Display the Duplicate Account Button + Bell Notification: Duplicate Account button/action to the Account Lightning Record Page and configured Conditional Visibility based on the Duplicate Account checkbox.

When the checkbox is set to True, the seller sees the Duplicate Account button along with a bell notification. This gives the seller an immediate indication that Salesforce has identified the Account as a duplicate and that the records need to be reviewed/merged.

4. Notify the Admin Team: When the seller clicks the Duplicate Account button, an email is automatically sent to our ticketing system and Admin reviews and merges both Prospect and Customer accounts.

Here are screenshots of the flow:  

  #Salesforce Admin #Flow #Sales Cloud

I recently implemented a Salesforce automation to simplify how we handle duplicate Prospect and Customer Accounts.

 

Flow 2.png

 

Flow 3.png

1 comment
  1. Today, 6:26 AM
    Thanks for sharing. This is very inspiring.
0/9000

🎉 Big shoutout to our incredible Forum Ambassador, @Manoj Nambirajan for an awesome deep dive on "Send Opportunity Notification for Specific Stage Movements"!📘 Check out the article here >> https://help.salesforce.com/s/articleView?id=005393369&type=1 

 

🔍 Found it helpful? Have thoughts to share?

 Let us know by clicking the "Yes" or "No"  button at the bottom of the article—your feedback helps us improve!🎉 Big shoutout to our incredible Forum Ambassador, for an awesome deep dive on> 🔍 Found it helpful?" style="display: block;" /> #Flow

1 comment
0/9000

I have a Flow that needs to send an email when a record is created on a Custom Object.  No matter what I put in the recipient field, I continue to get "0 recipients Error ID: 1728011022-505532"when I try to trigger the flow.  

 

What I first tried was go search resources, triggering record -> Respondent field (this looks up the contact) ->Contact ID:

How to set Recipient ID in Flow Send Email Action

 

 

When that failed, I tried several different versions of creating a text variable to look up the same thing and put that in the recipient ID field.  Again, no luck.  Finally, I switched the look-up from "Search Resources" to "Enter Text" and put in the text of a contact ID I know for sure is active and has a valid email address, but still got the error. 

 

For this flow, I need to have it pull the email address of the Contact (Respondent) listed in these records.  What am I missing? 

 

 

#Flow  #Flows  #Custom Objects

3 answers
  1. Aug 25, 4:56 AM

    Hi, see the tool tip on the Recipient Addresses field which says it needs to have an email address not id. Try using the hardcoded email address and test to see its working.Hi, see the tool tip on the Recipient Addresses field which says it needs to have an email address not id. Try using the hardcoded email address and test to see its working.

0/9000

I have a flow that guides users through a manual lead conversion, when converting to an opportunity they are able to select the opportunity record type that they want to create.  However the flow will give them the option of every available opportunity record type, not just the ones they have permissions for.  Is there a declarative solution to this , to only show the ones they have permissions for, without using an apex class? 

 

#Flow  #Record Types  #Permissionset

2 answers
  1. Aug 20, 12:54 PM

    Hi Carolyn - the catch is that RecordType is metadata every user can read, so a Get Records or Record Choice Set on RecordType always returns them all, regardless of who is assigned. There is no native 'filter record types by assignment' in Flow. Two routes that need no Apex you write or maintain: 

     

    1. UnofficialSF's 'User-Aware Record Type Picker for Flows' - a free installable screen component built for exactly this; it shows only the record types the running user is actually assigned. Cleanest option if you are OK installing a component. 

     

    2. Pure-native with Custom Permissions - create one Custom Permission per opportunity record type (or per group), assign each on the same permission set that grants that record type, then set each choice's component visibility (or a Decision) on the running user having that permission via Permission.YourCustomPermission. 100% declarative; the trade-off is you maintain the mapping, so it fits best when the record-type count is small. 

     

    Tip: also run the screen flow in User Mode so field/record access is enforced - just note User Mode will not filter the record-type list itself, since that is assignment, not record access. 

     

    If this helps, please mark it as the Best Answer so it helps the next person - thanks :)

0/9000

Howdy, 

 

I have a question about bulkifying scheduled flows. When you create one you have two options. Use a get element to grab the records you want or set an object & conditions. I've found the documentation confusing around which is the preferred method.

My understanding is that when you specify an object the flow will create an individual flow interview for each record. There is a limit of 250,000 flow interviews/24HRs along with all the normal limits. But if you have a sufficiently complex flow and expect it to pull in a large volume of records this is preferable as it prevents you from hitting nodes visited/DML limits.

In the case of using a Get statement, you don't have to worry about the flow interview limit, but you do need to worry about nodes visited/DML limits. Oh! And you get to work with collections! 

This makes me think that specifying an object is better for bulkification, I know there are other limits around date/time fields you can use in the criteria that might lead to one or the other, but from a pure bulkification best practices perspective specifying an object is correct?

Can anyone confirm my understanding or explain to me the correct way of thinking?

 

Additionally - in this help doc. There is the follow:

 

  • The maximum number of schedule-triggered flow interviews per 24 hours is 250,000, or the number of user licenses in your org multiplied by 200, whichever is greater. One interview is created for each record retrieved by the schedule-triggered flow’s query.If you specify an object so that the flow runs for a batch of records, then set the time, frequency, and record conditions to avoid reaching this limit. You can use debug logs to check how many records a schedule-triggered flow runs on. Track the number of records with the FLOW_START_SCHEDULED_RECORDS event. If your org reaches the limit, Salesforce sends a flow error email.

This seems to indicate that specifying an object is the preferred method, but it's really confusing to me.  Also I'm not sure what it means by the "schedule-triggered flow's query"

Thanks in advance!

3 answers
  1. Michael Brown (Salesforce) Forum Ambassador
    Dec 1, 2022, 3:15 PM

    Hey Thomas, I agree with your understanding. As a best practice, I agree that specifying the object up front in the entry conditions of the scheduled flow is the way to go, especially for bulkfication. I know there can be some confusion where admins will set a very generic entry criteria for the scheduled flow, and then use a get records inside the scheduled flow to drilldown to the records they want, but in my opinion, this can degrade performance as it's executing this get records for every iteration of the initial collection of records that met the criteria. It's usually more effective to have your entry criteria essentially be your Get Records element so that everything you need to gather upfront is already collected.    I liken using a Get Records inside a Scheduled Flow similar to using a Get Records inside a Flow Loop. It's not recommended because you can easily hit governor limits (although sometimes it is needed for complex scenarios)

0/9000

Hi all, 

We have detectandlaunch set up to launch a screen flow anytime the stage is changed on an opportunity. It is set up with the following guidelines:

- Flow API Name (when record is edited): our screen flow

- Flow API Name (when record is deleted) and (when record is loaded): blank

- Launch Mode: Modal

- Change Field: StageName

 

Our issue is that for some users, this screen flow is launched when the record is loaded, not edited. It is launching the correct flow, just not by the guidelines set within the visualforce page. There are no visibility filters on the flow itself for any user information, and the same goes for how the detectandlaunch component is setup on the page itself. I have not been able to find any documentation on any similar issues either. Any help is appreciated!

11 answers
  1. Yesterday, 2:49 PM

    @Grant Evans

     

    I have installed it in UAT and sent out testing instructions, asking my users to try and break it. I'll report back if they come across issues.

0/9000
1 answer
  1. Aug 25, 12:32 PM

    Hey Keshav, 

     

    This is a known Rich-Text-Formatted Body mismatch, your Body input is being fed rich text content, but the action isn't set to render it as HTML, so it shows the raw <p> tags instead of formatted text. 

     

    Fix in your Flow's Send Email action: 

    1. Find the Body/Text Template resource you're using 

    2. If your Text Template resource is set to Rich Text, you must also set Rich-Text-Formatted Body = True on the Send Email action, this tells Salesforce to render the HTML instead of showing it as plain text 

    3. If you don't need formatting at all, switch the Text Template to Plain Text instead, mixing Rich Text content with a Plain Text body setting is exactly what produces raw tags like <p>...</p> in the email 

     

    Also, since your screenshot shows Gmail flagging this as spam, that's a separate issue, likely caused by using a Trailhead Playground's default noreply/

    salesforce.com

    sending domain without proper SPF/DKIM setup, not related to the HTML tag issue. 

     

    Reference:

    https://wiki.sfxd.org/books/salesforce-quirks/page/flows-send-email-core-action-text-templates

0/9000

My experience site conditionally displays a flow button on our Grant record detail page. The condition is if the user is logged in, they can see and interact with flow button. I need to make it visible to guest users and logged in users. How can I do this? 

 

#Flow  #Experience Site

3 answers
  1. Aug 24, 4:24 PM

    Jordan, if there’s no component-visibility filter, I’d check the Guest User Profile permissions and how the button itself is configured.

    Since the flow already runs in System Context Without Sharing, the execution mode probably isn’t why the button is missing. I’d compare the guest user’s access to the object, Apex classes (if used), and the Experience Cloud page.

    Also check whether these are Dynamic Actions rather than an Experience Builder Flow component, since their visibility can be controlled separately.

    As a quick test, try adding the same flow through the standard Flow component and view the page while logged out. If that works, the issue is likely with the button/action configuration rather than the flow itself.

0/9000

I create a Flow with a Decision element that will reference the Sports field. I have to list 40 picklist values. I have to replicate this in the flow several times. What is a more efficient way to reference these 40 fields multiple times throughout the Flow without having to add the one by one every time. This will take a long tie to do. Thanks!

2 answers
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    Apr 13, 2024, 12:08 PM

    Do the same sports always go down the same decision paths? If so I'd write a formula with case function, something like:

    CASE(record.sport,

    'Basketball',1,

    'cricket',1,

    'cow tipping',2,

    'football, 2,

    3)

    Then the decision element you just have different paths for value 1,2,3 etc

0/9000