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
Matt Blatnik 8Matt Blatnik 8 

Mass Update Leads with Autolaunched Flow

Hi,

Can someone help me how to Mass Update Leads ( set value of field  x.  x__c = 1)



I have creasted a sobject collection variable "lstLeadFinal", followed by a flow with a
1. FAST LOOKUP where I am looking up all Lead records where x__c <> 1 and set variable  {!lstLeadUpdate}.
2. LOOP (loop through {!lstLeadUpdate} and create Loop Variable: {!loopLeadObj}
3. ASSIGNMENT ({!loopLeadObj.x__c} add {!conUpdateRecord1} [adds 1])
4. ASSIGNMENT ({!lstLeadFinal} add {!loopLeadObj}
5. FAST UPDATE as End of Loop (variable: {!lstLeadFinal})

When I run flow through process builder I get an error. 

Can someone help me how to get this to work?

Regards,

Matt
Rakesh51Rakesh51
How many records do you want to update ? if its more than 10K then use Apex trigger 
Matt Blatnik 8Matt Blatnik 8
Hi Rakesh,

Thanks for the tip. Though would still like to know and understand flows. Do you know why does the above not work? Or how to set up batches in flows? ie Update only first 5000 records?

Regards,

Matt