URL Hacking for Salesforce Dashboards (Preset Salesforce Dashboard Filters)

Share this article...

An Admin favorite feature that wasn’t technically supported by Salesforce was “URL hacking”; the ability to parse over URL parameters for setting values. However, this is now supported in Lightning Experience.

Yet, up to Spring ‘21, you couldn’t navigate to a dashboard with filters already set. Well, there’s good news here, thanks to an idea created in the IdeaExchange 9 years ago with 18260 points and 6 merged ideas, this feature was finally delivered.

“Prodly”

Now, anyone has the ability to open a dashboard with a filter set by the URL, removing the need to clone, replicate or have multiple dashboards.

How Salesforce Dashboard URL Hacking Works

In essence, it’s quite simple, you have to set the filter variable in the URL. There are a few parts to understand:

The Filter

The first important thing to note is that the filter values added to your URL must refer to the filters you have applied to the dashboard – you cannot reference fields as filters if they are not already added as a filter to the dashboard.

Each filter on your dashboard is an fv, which stands for Filter Value – easy to remember!

As you can have multiple filters, each filter also has a numerical value. So your first filter is fv0, your second filter is fv1 and your third filter is fv2.

After the fv value you will add = to set what the filter value is equal to, for example, if your filter is a picklist, you will enter the picklist value you wish to filter by.

In the screenshot below, you can see we are filtering by our our second dashboard filter fv1=.

The Value

Once you have set which filter it is, it’s time to add what value you are filtering by.

In our example we are filtering to only show closed cases.

So, we’ll update our filter to fv1=Closed.

Remember the values must match the available dashboard filter values!

The Spaces

You may have seen sometimes when copying URLs you find %20 as part of it, that’s simply the way to add a ‘space’ between words.

Putting it into context of our example if we wanted to filter by cases with status of In Progress the value would be In%20Progress.

The Link

Similarly to formulas and excel, to conglomerate values you add ‘&’ between statements, so to add a filter to your URL, you’ll add & before your first fv value.

In our example below, you can use the dashboard URL, then add & then the filter fv1= and lastly the value ‘by’.

If you had a second filter to add, you will again add an & then the filter and value.

What features aren’t yet supported?

Whilst playing around with this little feature I’ve noticed that it does not render dynamic dates. Even when set in the dashboard filters, using parameters such as TODAY or Last%20Month results in the following error:

From looking at the original idea:

“We have a standard dashboard for all Marketing Campaigns which can be filtered by each specific campaign to show general progress & statistics. On the Campaign object we would have a formula field which would link to the dashboard passing the ID of the campaign to the filter.

When viewing a campaign, users would then easily be able to jump to the campaign dashboard to see real-time statistics on the progress of the campaign.”

This sent me on an excursion to try! My findings suggest the functionality of filters in dashboards hadn’t really changed. They are explicit, you need to set the specific value. So for the use case described in the original idea they would have to set an ID or name of campaign per each permutation.

As there is always more than one way to achieve something, today you can overcome this with embedding specific reports and filtering on the Account ID. It’s not the whole dashboard, but it’s a start and it’s within the record context. Something like below:

So for the use case, in the original idea, this could have a tab within the page with some of the reports the dashboard uses and filtered by Campaign ID of the record the user is at.

Summary

As a famous UK slogan goes “every little helps”. Since the Spring ‘21 release we now have this little gem, giving us the ability to add filter parameters to the end of a dashboard URL. Have a play with it.

With the prediction that in mind, I think we will continue seeing enhancements on the ability of parsing parameters over the URL within the application. We’ll have to keep a close eye, until then, what’s on your wish list for this? Pop it in the comments section!

One thought on “URL Hacking for Salesforce Dashboards (Preset Salesforce Dashboard Filters)

Add Comment