3

Do we need batch update records in flows or does Salesforce automatically do this for us?

For example.

with a list of records: [Record1, Record2]

I want to loop through each one in the flow and then update in the following manner

record1.name = 'john' update record1

record2.name = 'matt' update record2

^ Will the above be very inefficient? or does Salesforce not actually update the record until the process builder that called the flow completes?

3

Records are updated at the moment you hit an update element. In other words, yes, you must bulkify your flows just as you would in Apex or the API. Place DML operations outside of a loop, or you'll run into limits quickly.

4
  • I am trying to update all the stage of all contacts in my opportunity contact roles to "opportunity". Not quite sure how to achieve this using flow. Jul 30 '19 at 22:43
  • @MatthewMetros You're have to add the records to a collection, then you update all at once.
    – sfdcfox
    Jul 30 '19 at 23:16
  • I am looking for documentation online surrounding this. Let me know if you know of anything. Jul 30 '19 at 23:55
  • @MatthewMetros I don't know of any. If you ask a more specific question (like, where you're stuck, etc), we'd be glad to assist you.
    – sfdcfox
    Jul 31 '19 at 0:44
2

I've always been under the impression that, as long as you don't transgress certain rules, flows auto bulkify as per:

https://help.salesforce.com/articleView?id=flow_concepts_bulkification.htm&type=5&sfdcIFrameOrigin=null

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.