+ Start a Discussion
Stephanie Holt 2Stephanie Holt 2 

Too many soql queries from Process Builder

I have a pretty simple process that is throwing an error when I try to use data loader or the data import wizard to add campaign members. It starts when a Campaign Member is created --> No criteria-just execute the actions! --> 2 immediate actions:

1. Update Lead First Campaign: 
User-added image
2. Update Contact First Campaign:
User-added image

Any ideas as to why this would throw a "too many SOQL queries" error? Here is the email with details: 


Error element myRule_1_A1 (FlowRecordUpdate).
This error occurred when the flow tried to update records: Too many SOQL queries: 101. For details, see API Exceptions.

This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.

Flow Details
Flow Name: Update_First_Asset_on_Lead
Type: Record Change Process
Version: 8
Status: Active

Flow Interview Details
Interview Label: Update_First_Asset_on_Lead-8_InterviewLabel
Current User: Stephanie Holt (00541000004Rm2r)
Start time: 3/16/2018 3:50 PM
Duration: 0 seconds

How the Interview Started
Stephanie Holt (00541000004Rm2r) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = 00v4100000RHJgBAAX

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "3/16/2018 3:50 PM"

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!formula_myRule_1} (true) Equals true
Logic: All conditions must be true (AND)

RECORD UPDATE: myRule_1_A1
Find all Lead records where:
First_Campaign__c Is null true
Id Equals {!myVariable_current.LeadId} (00Q4100000kHPKzEAO)
Update the records’ field values.
First_Campaign__c = {!myVariable_current.CampaignId} (70141000000LFrIAAW)
Result
Failed to update records that meet the filter criteria.

Error Occurred: Too many SOQL queries: 101
 
Raj VakatiRaj Vakati
Can you check is there any trigger for Lead or contact? That might be causing an issue. 

Can you share the debug logs to see the issue?
 
Stephanie Holt 2Stephanie Holt 2
We don't have any in-house built triggers on lead, contact or campaign member. There are a few that are through managed packages. I am not sure how to use the de-bug logs. I tried to look at that a while back, and had to move on to another project. Could you quickly explain how I should go about providing that to you, or a resource that may walk me throught it? User-added image
AthiSachiAthiSachi
following
AthiSachiAthiSachi
Hi Stephanie,
Hope you found answer already.. As I realized the reason, I thought I will share it.
When processing through Data loader, all records are considered as one transaction. Hence process builder will be loop for each record invoke. Hence the error. While data importing, Process builder has to be deactivated to avoid this error.