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
Max Friel.ax1251Max Friel.ax1251 

Using metadata api to retrieve a list of all reports

All,

I can not figure out how to do this and must be missing something simple.  If I setup a ListMetadataQuery and just set the type to "Report" I get nothing in return.  If I set the folder to null or "" I still get nothing in return.  If I set the Type to "Report" and set the folder to a folder with in the org then I get all the reports from that folder, which is expected.  What I need to know is, is there a way to get a list of folders for reports?  Or is there a way to list all the reports regardless of folder? Thanks in advance for any help. 

 

Regards,

Max

Best Answer chosen by Admin (Salesforce Developers) 
stripathystripathy

I think it has to be done in 2 steps. First you have to call ListMetadata to find out all the ReportFolders and then using the list of ReportFolders, calls ListMetadata again to find out all the Reports in those ReportFolders. Just a thought.

All Answers

MaxFrielMaxFriel

I guess the easiest way of asking this is for the ListMetadataQuery, does the method setFolder have a wildcard character that will return any result from any folder?  I tried "*" and it didn't work

stripathystripathy

I think it has to be done in 2 steps. First you have to call ListMetadata to find out all the ReportFolders and then using the list of ReportFolders, calls ListMetadata again to find out all the Reports in those ReportFolders. Just a thought.

This was selected as the best answer
MaxFrielMaxFriel

Awesome!! That is what I was missing.  Thanks a lot.  Its ReportFolder, for the record. 

Annabelle Carter 1Annabelle Carter 1
Hi!  I am a totally new person to this and would like to chat with either MaxFriel or Stripathy offline.  How do I get in touch with them.  Thank you for your help or suggestion.