Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hi,
I have a Power BI report which imports data from a couple of Salesforce Reports. One of these reports have more than 2,000 records. When I tried to display the data, it would only grab the first 2,000 records of the report if there are more than 2,000 records.
I did some investigation and it appears that it's by design for Salesforce Reports. https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_....
I was wondering is there a way to increase the number of records that can be imported to Power BI? Or is there a workaround on how to do this?
Jason
Solved! Go to Solution.
Hi @v-yanjiang-msft ,
thanks for your help. I ended up recreating the report using "Salesforce Objects" instead of using "Salesforce Reports". It looks like the 2,000 row limit is due to Salesforce's API and it has been like this for a while.
"Salesforce Objects" is more flexible, but it involves getting more familiar with Salesforce itself (e.g how the data is represented and how to find out what entity is what, etc.).
Jason
Hi @jasonyeung87 ,
You can use a filter on the object id column to exclude the first 2000 results and get the second 2000 until you fetch all the data:
Reports.ReportResults results = Reports.ReportManager.runReport('00O58000003sea0',true);
// pars the result to recive the first 2000 ids.
Reports.ReportFilter RF = new Reports.ReportFilter('ACCOUNT_ID', 'notEqual', ConcatOfReturnIds);
Reports.ReportMetadata RM = results.getReportMetadata();
list<Reports.ReportFilter>allfilters = new list<Reports.ReportFilter> {RF};
allfilters.addAll(RM.getReportFilters());
RM.setReportFilters(allfilters);
results = Reports.ReportManager.runReport('00O58000003sea0', RM,true);
System.debug(LoggingLevel.INFO,'res: '+results.getFactMap());
For more information see this blog, but don't use the callouts.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
Hi @v-yanjiang-msft ,
thanks for your help. I ended up recreating the report using "Salesforce Objects" instead of using "Salesforce Reports". It looks like the 2,000 row limit is due to Salesforce's API and it has been like this for a while.
"Salesforce Objects" is more flexible, but it involves getting more familiar with Salesforce itself (e.g how the data is represented and how to find out what entity is what, etc.).
Jason
Hi @jasonyeung87 ,
Glad your problem has been solved, if you have not other problems, would you mind accept your reply as solution.
Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj
User | Count |
---|---|
36 | |
31 | |
20 | |
11 | |
8 |
User | Count |
---|---|
52 | |
43 | |
28 | |
12 | |
11 |