Hi,
I'm not able to add/ set a 'get record' elemnt in flow ouside loop.
Issue:
The flow is working fine till end but hitting governor limits for 100+ records (soql: 101 limit) for 'Get follow up task' element because its inside a loop. So, how to set those 'Get Records' before a loop to avoid governor error? please suggest flow bulkification?
Below is the overview of scheduled triggered flow:
'Get lead' element : lead where country = India
Inside a lead loop ->
Decisions:
Condition 1: Check (If the lead has not been updated for 7 days since creation) If true, then -> task creation on lead.
Condition 2: Check (if the lead has not been updated for 7 days since creation) and (if a follow-up task is created on that lead) and (if the task status is not completed.) and (if lead is created within 42 days period)
If true -> Go for follow up Task Creation.
Inner Condition 2.1-> Repeat the Condition 2 for creation of follow up task until the latest task status marked as completed (Within 7 days) or if not completed (Within 7 days), then send follow ups till 42 days from lead creation days.
condition 3: If a follow-up task is created on current lead from loop and task status is marked as completed.
If true -> End flow for that lead.
Outside lead loop->
Create task element.
Thanks!
In get task -> checking task's whoid = loop current lead's Id
- You shouldn't use 'Get Records' inside the for loop, there is a limit of 100 SOQL.
- Try following this: https://www.hitteps.com/post/get-records-in-a-flow-using-a-collection