How to Work Around the Salesforce 2K Item Limit
[Deprecated] - Please use the new pagination feature Salesforce Pagination
The maximum number of rows returned by any SOQL over the REST API is 2.000 per request. In case your data source has more than 2k items the data will be cut off.
You can work around this limitation to request up to 6.000 items with the following workaround:
Merge Multiple Data Sources
Let say you have a data source called Salesforce Accounts
with the following query URL:
https://xxx.salesforce.com/services/data/v45.0/query/?q=Select name from account
Now let’s create a duplicate of this data source named Salesforce Accounts - Page 2
and use the following query URL:
https://xxx.salesforce.com/services/data/v45.0/query/?q=Select name from account Offset 2001
By adding Offset 2001
to the pull request, you request salesforce to return items starting at item no. 2001.
We now have two data sources: One for page one and another for the second page.
We now need to create a third data source with the Type
- Merge Data Sources
and name it something like Salesforce Accounts - Merged
Select the two previously created data sourcesn the field Datasources to merge
. This should look like this:
This is the final step. You can now use the merged data source in any field configuration. You may even extend it by adding a third page – but this approach doesn’t scale well and Salesforce only allows up to 5 connections like this in the first place.