Dynamic Report Filters in Salesforce

I have seen many customers in need to have Dynamic Filter. In Absence of Dynamic filter, many times we end up with creating multiple reports with same format and different condition.

Many time, we need something like get all cases related to Parent Account of Opportunity. We can simply create a report for Case and add Condition for Account Name. Using Some Custom Link, we can always Change Account Name and same report can be used many times.

While navigating to community i found very interesting and useful information regarding dynamic Filter in Reports.I thought that Dynamic Filters inside Salesforce is not possible but It is Possible.

Update – For Lightning Experience URL will look like


Salesforce does not have any official documentation on this, but here how it works.

Lets have look in below image:

Dynamic Filter in Reporting
Dynamic Filter in Reporting

Above report have three Filters. First Filter will be considered as “pv0”, second filter will be considered as “pv1” and so on.

In URL, we can provide parameter for Pv0, Pv1 like in above image.

Now, we can create a formula field to create a dynamic link which will open report. Something like



  1. hi i want to get the operator value of pno from the user we can get that one in this dynamic report .i am creating the report where user can go to vf page he can enter the aCCOUNT NAME IT WILL take automatically and .incase user need some other logic like not equal to like that how we can do it

  2. Hi Jitendra,

    Thanks for this article. I have a situation where there are many BDMs for them creating the same reports but only changing the owner of the record. Eg. Open Opportunities report for many BDMs according to their opportunities. So I guess i can use dynamic filter for that. Once I create the link, how do I display that on a Dashboard so that whoever click the link will display their report on the dashboad.

    Any help is appriciated,

  3. is it possible to allow user to select two different date field
    created date and lead qualified date , i want the user to select created date from — to —
    and lead qualified date from …. to ….
    user should select the date range

    I want to add the below logic
    (1 AND (2 OR 3) AND 4 AND 5)

    1. Five9 Log equals “True”

    2. Call Result contains “Lead” and created date from —- and to —-

    3. Lead Qualified equals and leaddate from —- and to —-

    4. External ID not equal to “”

    5. Territory Name equals “abc”

  4. Hi Jitendra

    I am working around a requirement, where the client wants three to four filters on a report. Say, Zone, Region, State, Product, From Date, To Date.

    So, if the user fills only Zone and hits the button to display the report, can my reports be this dynamic that it adds filter only specific to Zone. I see that in other case, it puts the other filters as blank and thus no data is displayed.

    Please help.


  5. Hi Jitendra, can we achieve the same in Lightning? URL hacking is not possible in Lightning. I want to implement this in lightning as well.

  6. Hi Jitendra,
    I’m stuck in a similar scenario where in I want to add a filter in a Dashboard that would extract some detail of a parent record. Is it possible?

  7. Hi All,

    we have a similar requirement using dynamic filtering example : we have fields like brand, division, claim type, factory,start date and end date etc.
    we have implemented form using visual force page and passed parameters through URL (pageReference(‘https://baseURL/lightning/r/Report/ID/view?fv0=’ + memberNameValue + ‘&fv1=’ + memberVCValue +
    ‘&fv2=’ + memberCCValue + ‘&fv3=’ + memberPLValue + ‘&fv4=’ + memberBrandValue+ ‘&fv5=’ + memberDivisionValue+ ‘&fv6=’ + memberLOValue+ ‘&fv7=’ + memberRCValue+ ‘&fv8=’ + memberSCDValue+ ‘&fv9=’ + memberECDValue+ ‘&fv10=’ + memberSSDValue+ ‘&fv11=’ + memberESDValue)

    when user select values and clicks on submit and then redirected to standard report to display selected values.

    in the report filter we are writing AND operator(1 AND 2 AND 3 etc) to generate only selected claims to display.but we are facing the issue report is showing nothing if user select any of the combination.

    Please help me to provide solution, how to write dynamic filter conditions in report or is there any other way to implement.

  8. Hi,
    When I try to pass the parameter in classic(pv0) and redirect to the report the report does not run by default.
    After redirecting to the report one has to manually click on the run report button.
    Any suggestions?

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.