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
Sajiv Kartha 3Sajiv Kartha 3 

How to extract workflow metadata into an excel ?

Hi,

I need to extract the Workflows Rules into an excel.  The fields required are 
                 Rule Name, Object Name, Evaluation Criteria, Description, Rule Criteria
Is there anyway to get this ?

thanks
Sajiv
jigarshahjigarshah
Sajiv,

There are 2 ways you can achieve this.

Approach 1 - Custom Visualforce Page
https://yourinstance.salesforce.com/services/data/v35.0/tooling/sobjects/workflowrule/describe
  • Have another Visualforce page say Page 2, where the content type of the page is set as follows. You will need to ensure that the Workflow rule info to be passed over to Page2 for it to be displayed within an excel.
<apex:page controller="contactquery" contentType="application/vnd.ms-excel#SalesForceExport.xls" cache="true">
    <apex:pageBlock title="Export Results" >
        <apex:pageBlockTable value="{!cs}" var="contact">
            <apex:column value="{!contact.ID}"/>
            <apex:column value="{!contact.Name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

Approach 2 - Custom Apex script & Report Type
  • Using a Scheduled Job or Setup > Developer Console > Execute Anonymous populate the Workflow metadata info by querying the Tooling API REST endpoint shown in approach 1.
  • Store the response in a custom object, lets say Workflow Metadata.
  • Create a Custom Report on the Workflow Metadata object and then using the Eport as CSV option from Salesforce Report Builder to export the workflow metadata information within a CSV / Excel.
jigarshahjigarshah
Sajiv, were you able to get this working?