Filter Reports via URL Parameters in Lightning Experience

No need to futz with filters! Pass URL parameters to set filter values in Lightning Experience reports. When linking to reports or when bookmarking a report, add filter value parameters to the URL to customize how the report filters when opened. For example, bookmark your opportunities report and add a filter value parameter to specify whether you see New Business or Existing Business. This feature is new in Lightning Experience.

Periodically throughout your day you check your opportunities report, and after opening it, you always edit a filter to show New Business or Existing Business. (The Type filter includes both New Business and Existing Business by default.)

Report without filter value URL parameter

Instead of loading the report, editing the filter, and reloading the report, create two bookmarks. One with a filter value parameter for New Business, and one with a filter value parameter for Existing Business. Take note of the opportunities report URL.

https://na1.salesforce.com/one/one.app#/sObject/00OR0000000PCHYMA4/view?t=1479844235107

Edit the URL to set the Type filter value to New Business by appending the parameter &fv0=New%20Business. The full, bookmarked URL reads:

https://na1.salesforce.com/one/one.app#/sObject/00OR0000000PCHYMA4/view?t=1479844235107&fv0=New%20Business

Let's take a closer look at what the parameter means.

  • & — Denotes a new parameter in the URL. If no other parameters are present in the URL, then substitute ? in place of &.
  • fv0 — The fv stands for "filter value," and is the name of the parameter. The 0 is the numerical order in which the filter appears in the report. (The first filter is 0, the second filter is 1, the third is 2, and so forth.) Standard filters don’t count in this order, and can’t be filtered using URL parameters, although they appear as the first three filters on any report. To set the value of the fifth filter in the report, specify fv4. In our example, we're filtering the first field filter in the report, the Type filter.

    The order in which filters appear in Lightning Experience on the report run page isn't necessarily the order that filters appear in the report. Locked filters are listed beneath unlocked filters on the run page, but aren't necessarily ordered after all the unlocked filters. To see the order of filters in your report, refer to their order in the Report Builder. Alternatively, make a GET call to /services/data/v39.0/analytics/reports/<report ID>/describe and note their order in the JSON response.

  • =New%20Business — Specifies that the Type filter value is New Business.

    The parameter value must be URI encoded, which means certain characters (such as spaces) must be written in a format that URLs can understand. In our example, the space (' ') between "New" and "Business" becomes %20 when URI encoded.

When you navigate to your opportunity report through the URL with a filter value parameter, the report opens filtered and ready to read.

Report with a filter value URL parameter
Take note of these limitations to setting filter values via the URL.
  • Only field filters support edits from URL parameters. Standard filters (role hierarchy filters, scope filters, date filters), cross filters, and row limit filters aren't supported. Standard, cross, and row limit filters don't count when listing filters — fv0 is the first field filter.
  • Chart filters aren't supported.
  • Filter operators (like equals and greater than) can't be modified via URL parameters.
  • You can’t change the field being filtered via URL parameters.
  • You can't add new filters to reports using filter value URL parameters. You can only modify existing filters.
  • You can’t delete filters from reports using filter value URL parameters. Setting a blank value filters by no text or numerals, but doesn’t remove the filter.