function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Stefaan Somers 12Stefaan Somers 12 

Why do I get error of 10 chunks when updating list of records in Lightning Flow

In Lightning Flow I have a variable with a list of records that need to be updated, which I fill through a loop. When I wan't to do the update, I always get the error : 
12:24:26.351 (504433867)|FLOW_ELEMENT_ERROR|LIMIT_EXCEEDED: Cannot have more than 10 chunks in a single operation. Please rearrange the data to reduce chunking.|FlowRecordUpdate|UpdateRecord
12:24:26.351 (504638795)|FLOW_ELEMENT_END|613991d2bb2c20ff3bc830ae528716b21ff7f9a-2d89|FlowRecordUpdate|UpdateRecord

But the variable of the list is specified as a list of a specific Object-type

Arun ParmarArun Parmar

Hi Stefaan Somers,

You have to bind objects in list or call them separate.
you have to create a map of key to List<Sobject>.
Map<Schema.SObjectType, List<Sobject>> sortedMapPerObjectType = new Map<Schema.SObjectType, List<Sobject>>();

you have to execute objects one by one, i.e. suppose you List contains 3 sobjects (contact,account and Opportuniy) then, first exceute contacts, than accounts and than opportunities.

Hope it will help you.

Stefaan Somers 12Stefaan Somers 12
How do you do this within Flow??
I pass the parameter !Selected as input-parameter to flow
Deepali KulshresthaDeepali Kulshrestha
Hi Stefaan,
Greetings to you!
- Here is the solution for your problem as your's, Please check below link. : -

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha.