Been spending a long time trying to get all the info about a report programmatically using apex. One place I'm stuck at is how to get the folder name where the report is located in, and also its permissions, which means what role do you need in order to access this report. Take a look at this image for example.

enter image description here

Basically I just need to get the name "Folder for Testing", since that is where my report is located in.

I've tried using several methods from metadata api, reportResults, reportExtendedMetadata, but still no luck. I thought I would be able to do it using a SOQL query, but I'm still working on that. Any help is much appreciated.


  • what is known to you before starting off this logic? You only know the report name and then need to get the related info in your question? Dec 14, 2021 at 19:57
  • Sorry, I should've added that I have other stuff about the report such as its ID, name, fields, columns, filters etc. This is just the last piece of info that I need.
    – apexdev
    Dec 14, 2021 at 20:18

1 Answer 1


The Report object has a FolderName field that should contain what you are looking for. As for how to run the query, I personally would just run it through the Developer Console (it has a Query Editor tab). You can add fields you care about to your SELECT clause.

SELECT FolderName FROM Report WHERE DeveloperName = 'My_Report'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .