1

I have a complex requirement that iterates over 277 records. I have achieved it using scheduled flows.

For each of the 277 records, I need to automatically create related records, which I have done using loops. As expected, I get the "Too many SOQL queries: 101" error, is there a way to overcome this?

Update:

enter image description here

0

2 Answers 2

2

Yes. What you should do is the same as you'd do in a trigger. Get the list of elements, loop over each item, then update the collection. Here's what that looks like:

Example Flow

This is, of course, a Visual Flow, but the same rules would apply for autolaunched flows as well. Query, create or update records in memory, then commit all changes.

1
  • Thanks for the idea, but the flow I have added in the question is the MVP, whereas the actual use case is more complex than that. I have found out that using "Pause" element to make it an asynchronous flow works. Mar 23, 2020 at 3:37
0

Since my use case is a scheduled flow, the following worked. The idea is to make it asynchronous by adding a Pause element.

https://success.salesforce.com/ideaView?id=0873A000000COJ1QAO

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .