Loading
Feature degradation | Gmail Email delivery failureRead More
Set Up and Maintain Your Salesforce Organization
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Bulk Move Reports or Dashboards with Metadata API

          Bulk Move Reports or Dashboards with Metadata API

          You can move reports or dashboards between folders and subfolders in Lightning Experience. If you want to move reports or dashboards in bulk, use Metadata API.

          For example, the Some Old Deprecated Folder folder contains two reports: My Accounts Report and My Opty Report. You want to move My Accounts Report to a new folder called Accounts and My Opty Report to the new Opportunities folder.

          reportlist1

          This example uses Reports and Dashboards REST API to get the details of the reports that you want to move and Metadata API to move the reports. (The same process works for dashboards.) You can use Postman or cURL to call Reports and Dashboards REST API. You can use Salesforce Extensions for Visual Studio Code or Salesforce CLI to execute Metadata API. You can follow a similar process using the force.com ANT migration tool.

          1. Get a list of your reports using the Reports and Dashboards REST API report resource PATCH method.
          2. Search the list to get the developer names of the reports you want to move and the ID of the folder they are in.
          3. Use the folder ID to obtain the folder’s developer name with the folder operation GET method.
          4. Create a package.xml manifest using the folder and file developer names as members.
            <?xml version="1.0" encoding="UTF-8"?> 
            <Package xmlns="http://soap.sforce.com/2006/04/metadata"> 
                <types> 
                    <name>Report</name> 
                    <members>Some_Old_Deprecated_Folder/My_Accounts_Report_eQ</members> 
                    <members>Some_Old_Deprecated_Folder/My_Opty_Report_CO</members> 
                </types> <version>43.0</version> 
            </Package>
          5. Retrieve a package that contains the reports using the Metadata API retrieve() call.
          6. Unzip the package.
            reportlst2
          7. In the unzipped package, create the new folder and file structure.
            reportlist4
          8. In the package.xml file manifest, change the folder structure to match the changes that you made in the unzipped package.
            <?xml version="1.0" encoding="UTF-8"?>
            <Package xmlns="http://soap.sforce.com/2006/04/metadata">
               <types>
                   <members>Accounts/My_Accounts_Report_eQ</members>
                   <members>Opportunities/My_Opty_Report_CO</members>
                   <name>Report</name>
               </types>
               <version>43.0</version>
            </Package>
          9. Create the new folders in Lightning Experience.
            reportlist5
          10. Create the package for deployment.
            This command creates a ZIP file from the contents of the unzipped package directory called unpackaged.
            zip -r move_reports.zip unpackaged/
          11. Deploy the package that contains the moved reports using the Metadata API deploy() call.

          The move is complete. Some Old Deprecated Folder is empty, and you can delete it in the UI.

           
          Loading
          Salesforce Help | Article