Skip to main content

#Flow167 人正在讨论

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 个回答
  1. 昨天,04:56

    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 个回答
  1. 8月20日 12:54

    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 个回答
  1. Michael Brown (Salesforce) Forum Ambassador
    2022年12月1日 15:15

    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 个回答
  1. 8月25日 14:49

    @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 个回答
  1. 昨天,12:32

    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 个回答
  1. 昨天,16:24

    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 个回答
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    2024年4月13日 12:08

    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

I’m running into a wall with an autolunched subflow designed to process over 2,000 retail store records.

What the flow is doing:

1. Iterating over a collection of input stores via a Loop element.

2. Passing each item through an Assignment block (varRSSA.Retail Store = Loop Stores > Retail Store ID) and adding it to a collection variable (colRSSA).

3. Attempting to bulk insert colRSSA after the loop finishes.

The Issue:

The flow runs successfully end-to-end without throwing an error, but zero records are actually written to the database when checking the developer console. I’ve attached screenshots of my current loop layout and collection variables.

Could anyone share the cleanest way to structure a loop-to-collection and bulk insert for large volumes (2k+ records) in a subflow without hitting silent drop-offs or bypasses? Any advice or layout examples would be massively appreciated!

 

 

#Flow

1 条评论
  1. 8月21日 00:23

    Hi Mark - 'runs clean but zero rows' almost always means the Create IS failing and the error is being swallowed. Two fast moves to expose it: 

     

    1. Add a Fault Path to your Create Records element (drag from the red node) and route it to a Screen showing {!$Flow.FaultMessage}, or run Flow Debug with 'Show query and DML details' ticked. Debug prints the collection size going INTO the create and how many rows it inserted - that instantly tells you whether the collection is empty or the records are invalid. 

     

    The most common silent-zero with your exact pattern: 

     

    2. The records in colRSSA carry an Id. For an INSERT the record vars must have NO Id - if your Assignment copies a source Retail Store record (which brings its Id along) instead of building a fresh record, the create no-ops. Build a NEW record variable with only the fields you set, no Id. 

     

    Also check: 

    - Create Records set to 'Multiple' from the COLLECTION (colRSSA), not 'One' from the single var. If debug shows colRSSA empty, your add-to-collection Assignment is the culprit - it must use the Add operator with colRSSA as the target. 

    - Run the subflow in System Context (Without Sharing) if the running user may lack Create on Retail Store - DML silently no-ops in user context. 

    - Any required field beyond the lookup fails the row; the fault message names it. 

     

    Clean pattern: Loop > Assignment (set fields on a fresh record var, no Id) > Assignment (Add var to colRSSA) > after the loop, Create Records (Multiple, from colRSSA). 

     

    Hope that unblocks it 🙂

0/9000

I am using flow to send SMS to a customer. This works fine, but for new Messaging End Users, it can take up to 10 minutes before the SMS is sent and the Messaging Session is created.

I need to link the messaging session to the case where the users started the flow from, but the session isn't available right away.

 

I tried to use a record triggered flow on Messaging Session, but the flow isn't triggered. Any ideas to why the new Messaging Session doesn't trigger the flow?

11 个回答
  1. 8月19日 10:12

    Hi Team,

    I faced the same issue and found a solution that worked for me.

    My requirement was to link a newly created Messaging Session to the Case from which the session was initiated using a Screen Flow.

    Solution:

    Enable Change Data Capture (CDC) for the Messaging Session object in Setup. This publishes a change event whenever an action occurs on a Messaging Session record, such as create, update, or delete. The event message provides the Messaging Session record ID and its field values, including the Messaging User ID.

    First, store the Case ID on the Messaging User record within the Screen Flow (or from wherever you are initiating the Messaging Session).

    Since a Messaging Session change event is published whenever an event occurs on the record, subscribe to it using either a Platform Event-Triggered Flow or an Apex Trigger on the Messaging Session Change Event. Then perform the required logic:

    1. Retrieve the Messaging User ID from the Messaging Session event.
    2. Use the Messaging User record to get the Case ID that was stored earlier.
    3. Update the Messaging Session record using the Messaging Session ID received in the event and the Case ID which we get by query the messaging user.

    This will successfully link the Messaging Session to the Case.

    If you need code samples or additional guidance for implementing this solution, please reply to this comment. 

     

    Thanks.

0/9000