How to Create Dynamic Filter in Salesforce Report

When you are working on an account object, and you need to create an account report and want to show all opportunities associated with the account, the dynamic filter makes this task easier. As you click on the button, your report will be ready.

In this Salesforce tutorial, we will learn about Dynamic Filter in Salesforce Report. In that, we will see what a dynamic report is and what. We will see step by step How to create a Dynamic Filter Report in Salesforce Lightning and Salesforce Classic.

Dynamic Filter in Salesforce

What is the dynamic filter in Salesforce?

In Salesforce, a dynamic filter report refers to a report where the user can adjust the filter criteria without modifying the report definition itself. By using dynamic filters, users can easily manipulate report data without the need for report customization or creating multiple versions of the same report.

What are the uses of dynamic filters in Salesforce?

Following are the key features and uses of dynamic filters in Salesforce.

  • Interactive Filtering: Users can modify the filter conditions without needing to edit the report.
  • Real-Time-Data Refresh: When users apply or modify filter criteria in a dynamic filter report, the report’s data refreshes in real time to reflect the updated filtering conditions.
  • Easy to use: The interface for dynamic filter reports is designed as echo-friendly; hence, it is easy to use for the users.

Scenario:

Let’s consider a scenario: You want to see all records in the report based on the current account’s state. Here, the filter does not support the dynamic value. So, the user needs to create multiple reports with multiple filter conditions.

This dynamic filter value or dynamic report can be accomplished by using a Custom Link or button approach and passing parameters through a URL.

See also  Joined Reports in Salesforce

Points to be remembered when creating the dynamic filter report.

  1. Dynamic filter does not contain any value.
  2. The field filter order is important.
  3. Record ID.

How to Create Dynamic Filter Report in Salesforce Lightning

Using the following steps, we can create a dynamic filter report in Salesforce.

1. Go to “App Launcher” -> Search “Reports” -> Click on Reports.

Create dynamic Report in Salesforce Lightning

2. Click the “New Report” button to create a new report.

Dynamic Report in Salesforce Lightning

3. Go to All category -> to select a Report Type, Search “Account“, you can search on which object you want to create a report. -> Select Account.

Apply dynamic Report in Salesforce

4. To apply the dynamic filter, use the following steps.

  • Step 1: Click on the Filter option to add the filter.
  • Step 2: Then, Click on the Add Filter option. You can select any field to apply the filter. Here, I have selected the Account ID field.
  • Step 3: Select the operator as equals.
  • Step 4: As we discussed in the value field, the dynamic filter does not contain any value; that’s why keep it empty.
  • Step 5: Click on the Apply button.
Appling dynamic Report in Salesforce

5. After Applying the filter, you need to save and run and save a report. As you click on the Run Report button, all records that we can see earlier after clicking the run button, all records will disappear, and you will see 0 records.

6. This will happen because we have left the value field empty.

7. After that, copy the URL of the window where you have run the report.

8. Now, you need to create a Detail Page Button and add this button in Page Layout on which object you have created the report.

You can read the whole article on Add Button, Links, and Actions: ……………….

9. At the time of creating the button you need to add this URL to link this page. In this URL you need to add some extra text that I have shown below.

See also  How to Create Gauge Dashboard Component in Salesforce

In the URL, at last, after the view, you need to add – ?fv0={!Account.Id}&fv1={!$User.FirstName}. You can add any fields related to which object you are creating the report.

Create new dynamic Report in Salesforce Lightning

10. Go to the Object on which you have created a Dynamic Report.

  • Step 1: Here, I have selected Account Object.
  • Step 2: Then Click on the details button.
  • Step 3: On the right corner, you will see a dropdown arrow. Click on that arrow.
  • Step 4: In that, you will View Acc Report button name I have given while creating the Button.
Apply dynamic Report in Salesforce Lightning

11. After clicking on the View Acc Report button, you will be redirected to the Report Page.

Result dynamic Report in Salesforce

This is how we can create a dynamic filter report in Salesforce Lightning.

How to Create Dynamic Filter Report in Salesforce Classic

Scenario:

Let’s consider a scenario where you are on an account object, and you want to see a report account associated with an opportunity from the current account. Here, we can use the dynamic report option.

Using the above scenario, we will see how we can achieve this scenario and create a dynamic filter report in Salesforce.

1. Go to All Tabs -> You will see the “Reports” tab -> Click on the Reports tab.

Apply Dynamic filter in salesforce Classic

2. Then click on the “New Reports” button to create a new report.

Dynamic Filter in Salesforce classic

3. Select the Object, here I have selected “Opportunities” Object -> Click on the Create button.

Create dynamic Report in Salesforce Classic

4. Here, we want to show all opportunities associated with the account.

  • Click on the add Filter option -> Select field as an Account ID -> Select operator as equals.
  • Leave the value field as Empty. -> Click on the OK button.
Apply dynamic Report in Salesforce Classic

5. As you click on Save and Run report, you will see all the records that we can see earlier. After clicking the run button, all records will disappear, and you will see 0 records.

Create new dynamic Report in Salesforce Classic

6. After that, copy the URL of the window where you have run the report. This URL you need to set as a button link while button creation.

See also  How to Delete Schedule Report in Salesforce

ashoresystempvtltdpune-dev-ed.my.salesforce.com/00O5i00000BAwjj?pv0={!Account.Id}

After creating the button you need to add that button to the account page layout.

Create the Dynamic Filter in Salesforce Classic

7. After adding the button, when you want to see the report, you can simply click on the Opp & Acc Dynamic Report button.

dynamic Report in Salesforce Classic

8. After clicking on the Opp & Acc Dynamic Report button, you will be redirected to the Report Page.

Here, you can see we have clicked on the button when we are on the Account Detail page, and after clicking on the button, we will see opportunities associated with the account that the record has displayed.

Dynamic Filter Report in Salesforce Classic

This is how we can create a dynamic filter report in Salesforce Classic.

Conclusion

In this tutorial, I hope you got an idea about dynamic filter reports in Salesforce, what a dynamic report is, and what its uses are. We have seen how to create dynamic filter reports in Salesforce Lightning and Salesforce Classic.

You may like to read: