Filter Page via URL?

Reply
Visitor

Filter Page via URL?

I am working on building a page that users will frequently filter by a single field, AccountID (it's a page of account performance metrics, designed to filter to see a single account's performance over time). 

 

I'm hoping to configure a page filter via the page URL. The idea would be to have a dynamic link in SalesForce that inserts the AccountID, so that the Domo page loads automatically filtered down to that account with no extra clicks needed. 

 

This article on links in Beast Mode indicates that it's possible to do this inside of Beast Mode calculations, so it seems like it should be possible to filter the way I'm trying to when linking from another source. But the format given there doesn't seem to work (possibly due to encoded characters?).

 

Is there another way to achieve this? Or is this the correct way and I am missing something else? Seems like a pretty straightforward use case, I can't imagine I'm the only one trying to do it.

 

https://yourdomoinstance.domo.com/page/1111111111?pfilters=['
     ,'{"column":"your_field1",
     "dataSourceId":"your_datasource _Id",
     "dataType":"string",
     "operand":"IN",
     "values":["'
           ,`your_field1`
     ,'"]}


Accepted Solutions
Visitor

Re: Filter Page via URL?

I was able to get this working by using this query string on a page of cards:

 

https://yourdomoinstance.domo.com/page/1111111111?pfilters=[{"column":"COLUMN_NAME","dataSourceId":
"DATASET_ID","dataType":"string","operand":"IN","values":["FILTER_VALUE"]}]

 

COLUMN_NAME = the string of the column name you want to filter on

DATASET_ID = the dataset ID (found by going to the dataset page and getting the ID from the URL)

FILTER_VALUE = the value(s) that you want to filter on (comma separated strings)

Nate Jackson

All Replies
Moderator

Re: Filter Page via URL?

Could someone help with this issue?

Visitor

Re: Filter Page via URL?

I was able to get this working by using this query string on a page of cards:

 

https://yourdomoinstance.domo.com/page/1111111111?pfilters=[{"column":"COLUMN_NAME","dataSourceId":
"DATASET_ID","dataType":"string","operand":"IN","values":["FILTER_VALUE"]}]

 

COLUMN_NAME = the string of the column name you want to filter on

DATASET_ID = the dataset ID (found by going to the dataset page and getting the ID from the URL)

FILTER_VALUE = the value(s) that you want to filter on (comma separated strings)

Nate Jackson
CJ
Visitor

Re: Filter Page via URL?

I managed to get this to work as well but can not find any documentation of all the available options we can use in pfilters.  In particular I'm wondering how to set the apply to all datasets option and how you handle datatype LONG comparisons or any other data type.  I can use the syntax below and get it working but the pagefilter on the page shows >= while it is actually filtered to the correct account.

Highlighted
WHM Yellow Belt
Yellow Belt

Re: Filter Page via URL?

Whiskey Tango Foxtrot?!?! I have been looking for this question for half an hour and only found the link to the thread after posting, in essence, the exact same question. Thanks for doing all this work ahead of me! I will have to test out your solutions

WHM Yellow Belt
Yellow Belt

Re: Filter Page via URL?

I found that if you exclude the dataset specification, it applies the filter to all datasets on the page... 

CJ
Visitor

Re: Filter Page via URL?

Yup it works well.  I posted this up here a while back as well.

 

https://dojo.domo.com/t5/Card-Building/Embedded-Cards-in-Salesforce-Dynamic-Filter/m-p/26993#M3073

 

 

Visitor

Re: Filter Page via URL?

Could someone using this type of solution give me an idea of how it affects other users of the same page? For example. I've built a page and I had saved a default set of filters to it that would allow the end user to select different time periods, regions, districts etc but thought it would useful for individual store managers to access the page via one of these dynamic links to pre-filter the cards down to just their location. (It's not that they're not allowed to see other locations, that's why I'm not using Group security... I just wanted to make it easy for them to see their location first)

 

The link itself worked as intended and loaded me directly into the page filtered to the location. But the 'default filters' I had saved previously are gone and now anytime I try to access the page through the normal Domo navigation the page filter that was created by the URL click is still active. 

 

Is it possible this is only happening because I'm using the URL as the page administrator? Would a "normal" user still be able to delete/reset the default page filters for all other users?

Visitor

Re: Filter Page via URL?

WHM Yellow Belt
Yellow Belt

Re: Filter Page via URL?

here is the BeastMode we use to go from a region card to a store dashboard based on the store number:

 

concat('<a href="https://company.domo.com/page/7100239411?pfilters=[{%22column%22:%22ssc_number%22,%22dataType%22:%22...>')

 

is looks for the ssc number in the ssc_number or business_area columns. Hope this helps. 

Announcements
Looking for the latest Community solutions? Please visit our accepted solutions board here!