Retrieving Reports through ANT


To retrieve Report using Metadata API, we need to know
I ).  "Developer Name" of the Report
II ). "Folder" Name of the Report

To get these details, run the below SOQL query :
1
SELECT Name,DeveloperName,FolderName FROM Report

Assume, the output of the above query is :

Name DeveloperName FolderName
Multi-Product Speakers Multi_Product_Speakers Public Reports
Cap Review: duration type = multi/zero Cap_Review_duration TAL Reports

Now, the "package.xml" file is :
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

    <types>
        <members>unfiled$public/Multi_Product_Speakers</members>
  <members>TAL Reports/Cap_Review_duration</members>
  <name>Report</name>
    </types>
    <version>44.0</version>
</Package>
Here:
- In the back end "Public folder" = on UI "Unfiled Public Reports" =  In Metadata API "unfiled$public".
- If it is a custom folder then give the name same as SOQL query result.
- If it is a "My Personal Custom Reports" those cannot be retrieved using Metadata API. Here is the Idea Link from Salesforce.

tHiNk gooD and dO thE bEsT.........MANJU NATH 🌝

Comments