2

We are working with the Salesforce REST API to fetch reports.

When fetching more than 2000 records from a report how does the pagination work? Is there any querystring parameter to append to the URL so we can access the next page(s) of users?

This is what the URL looks like.

$url = "{$instance_url}/services/data/v42.0/analytics/reports/00xxxxxxxxxxA5"; 

If possible, we would like not to use SQL queries, but directly the analytics/reports endpoint.

identigral
  • 7,543
  • 29
  • 32
  • 42
Platoscave
  • 33
  • 5
  • Welcome to Salesforce Stack Exchange (SFSE)! A couple of possible answers: https://salesforce.stackexchange.com/q/242103/81648 | https://salesforce.stackexchange.com/q/226973/81648 – Moonpie Sep 01 '22 at 11:58
  • @Moonpie Thanks for that -- but is there any way to get pagination working on the analytics/reports endpoint? – Platoscave Sep 01 '22 at 12:01
  • I have no experience so can't say directly. But the accepted answer to the second question I linked to addresses analytics/reports. Is that an approach that you can use? – Moonpie Sep 01 '22 at 12:07
  • 1
    @Moonpie I think even on the second question they still suggest using SOQL, if I am not wrong. In the docs I couldn't find anything about the pagination in the analytics/reports endpoint. – Ionică Bizău Sep 01 '22 at 13:50
  • Out of the box - no, you have do it yourself with a filter by ordering (sorting) the report on whatever unique field such as a record ID. Vote for this idea: https://ideas.salesforce.com/s/idea/a0B8W00000Gda98UAB/increase-the-analytics-rest-api-limit-of-2000-report-rows – identigral Sep 01 '22 at 15:11
  • @identigral : Please put that as an answer! – Moonpie Sep 01 '22 at 15:21

0 Answers0