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`
     ,'"]}

Best Answer

  • NateJson
    NateJson Member
    Answer ✓

    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)

Answers

  • KaLin
    KaLin Member

    Could someone help with this issue?

  • NateJson
    NateJson Member
    Answer ✓

    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)

  • 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.

  • WHM
    WHM Contributor

    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
    WHM Contributor

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

  • CJ
    CJ Member

    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

     

     

  • 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?

  • WHM
    WHM Contributor

    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:%22string%22,%22operand%22:%22IN%22,%22values%22:[%22',`ssc_number`,'%22]}]">',`business_area`,'</a>')

     

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

  • The filters work well for "Dashboard-Pages", but not for Detail-Pages.

     

    What do i have to change for applying this to Detail-Pages?

  • Duc
    Duc Member

    Can this really cool functionality be applied to a single card as well?

  • Hello


    I have this very same issue and I am not accessing the link as the page administrator. This is very bothering because it results in users modifying other user's view just by the fact of clicking these type of URLs

     

    Any idea on how to prevent this?

     

    regards

This discussion has been closed.