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
Joe Rodden 7Joe Rodden 7 

Flow hitting Row Limit

Running into the following error via the Debug Console when running a flow:
System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

The flow essentially takes a unique identifier on a custom object and attempts to find a lead or contact with that same unique ID. Worked fine in a sandbox, but when pushing into our full copy it no longer works if it has to look for a lead. My guess is it's because there are so many leads. Any thoughts on how to get around this limit via flow? Not a developer by trade. Current flow below, its called via process builder when the custom object is inserted.

User-added image
Aman MalikAman Malik
Try to add filters while doing Fast Lookup.