bdunagan

fill the void - bdunagan

29 Jan 2017
How to Fetch Any Salesforce Report using Ruby and Restforce

Salesforce Reports provide support for a wide range of queries. After selecting the main object to report on, I can add complex filtering, search cross-linked objects, and include attributes from related objects, while seeing the results in the standard Salesforce Reports view.

Compare this to searching in Ruby using Restforce. I can search the attributes of one object in code. No related object attributes or complex filtering or cross-linked objects without more code, and on top of that, no visibility through the website. Seeing the results in Salesforce is crucial, both for at-a-glance data verification and for sharing the report amongst a sales team (who don’t write code).

Fortunately, with Salesforce Analytics API, we can bring the power and visibility of Salesforce Reports into Ruby. (Note though that the results are limited to 2,000 rows.) I wrote the following class to fetch a Salesforce Report and package it up into a Report object with name, filters, and rows. Feel free to use it.

Previous LinkedIn Twitter GitHub Email Home