0

How can I find all reports in my Salesforce instance where the report is filtered by a specific field and value.

We need to surface this data to management because they want to make adjustments to those specific reports.

Ex. I want to find all reports in our Salesforce that are filtered with the Case Status of "Open".

1 Answer 1

3

First step would be to pull all your reports' metadata in VS Code with sfdx

sfdx force:source:retrieve -m Report

Within that metadata, report filters have a specific syntax

<filter>
    <criteriaItems>
        <column>AMOUNT</column>
        <operator>greaterThan</operator>
        <value>1000</value>
    </criteriaItems>
</filter>

In your case, you're looking for Status so you now search through the metadata you pulled to find the reports with those references.

In VS Code, you can search all (CTRL + Shift + F) and specify what type of files to include (report-meta.xml).

You can find a report you know has the filter and just copy the beginning part (with spacing/line breaks). I'd use something like the below to get all instance of using Status in the filter at all.

<filter>
        <criteriaItems>
            <column>STATUS</column>

However, if you need more specificity (equals Open), you can copy the whole block to search with

<filter>
    <criteriaItems>
        <column>STATUS</column>
        <columnToColumn>false</columnToColumn>
        <isUnlocked>true</isUnlocked>
        <operator>equals</operator>
        <value>Open</value>
    </criteriaItems>
    <language>en_US</language>
</filter>

However, any slight difference (filter is locked vs. unlocked) won't appear in your search results which is why I'd go for less specific - all depends on the # of reports you're dealing with.

enter image description here

You must log in to answer this question.

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