Salesforce Too Many SOQL Queries: 101 Error
Quick answer
The transaction ran more than 100 SOQL queries. Move queries out of loops (Get Records in a Flow loop, queries in Apex loops) and check for recursion.
Most likely fix: Bulkify the Flow
How to fix it
Try these in order — the most common fix is first.
1. Bulkify the Flow
- Open the Flow in Setup > Flows
- Move any Get Records element out of the Loop
- Query once for the whole collection, then loop over it in memory
- Use a Decision to skip records that need no lookup
Did this fix it?2. Bulkify Apex
- Collect IDs into a Set before the loop
- Run one SOQL query with WHERE Id IN :ids
- Store results in a Map and read from it inside the loop
Did this fix it?3. Check recursion and other automation
- Use a static boolean in trigger handlers to run logic once per transaction
- Review other Flows, Process Builders and packages on the same object
- Use debug logs and Limits.getQueries() to see where queries are spent
Did this fix it?4. Test with bulk volumes
- Test with 200 records, not one, because the error often appears only on data loads
Did this fix it?
Symptoms
A Flow, trigger or data load fails with System.LimitException: Too many SOQL queries: 101.
Why it happens
- Get Records inside a Flow Loop
- SOQL inside an Apex for loop
- Several automations and managed packages in one transaction share the limit
- Trigger recursion
This guide also covers
- too many soql queries 101
- salesforce flow too many soql queries
- systemlimitexception too many soql
Still not working?
If Salesforce keeps failing, you're not alone. See every Salesforce problem users report or the alternatives people switch to.
Done fighting Salesforce? Our small team builds your own Salesforce alternative, made for how you work. On your domain or hosted by us. Price agreed together.
Get a quoteThe same problem in other apps
All not loading, error messages & connection guides →
- HubSpot Import Errors (HubSpot)
- Pipedrive Import Errors and Skipped Rows (Pipedrive)
Other Salesforce errors
- How to Cancel Salesforce Subscription
- Salesforce REQUEST_LIMIT_EXCEEDED Error
- Salesforce STORAGE_LIMIT_EXCEEDED Error
- Salesforce UNABLE_TO_LOCK_ROW Error
- Salesforce Einstein Activity Capture Not Syncing
- Salesforce Emails Not Sending
- Salesforce Data Loader INVALID_LOGIN Error
- Salesforce MFA Locked Out: Lost Authenticator