Skip to main content
Domo Knowledge Base

Using Pfilters to Apply Filters from URL Query Parameters to Embedded Dashboards

Version 3



You can use Pfilters (Python particle filters) to apply filters from URL query parameters to embedded Domo Stories as a layer after SSO or programmatic filtering. The Pfilter acts as an array of page filter objects. Any matching column names will be filtered upon page load even if they are based on different DataSets. Results can be validated in POST requests on the network tab. 


Example #1 

The following multi-line example shows Pfilters being used to apply filters to an embedded Domo Story. Example is broken up into multiple lines:













Example #2

Here is another example, which also shows Pfilters being used to apply filters to a Story but keeps the code in a single line:]}]




The operands you can use when writing code with Pfilters are as follows. Note that the values always need square brackets for the array, even when only a single value is included.  

  • IN








Persistence of Pfilters across pages

Domo automatically creates Pfilters when you check Persist Filters in the embed dialog, as shown here:


You can then view the parameters by hovering over the content. (Card interactions must be turned on and set to External link for this to work). This is shown for the "QA pass rate by model" Card in the following example:


When viewers click those links, any parts of the story they had previously clicked will be passed along as Pfilters to the next Page. These filters can either be applied to single Cards or complete Pages (even if the Pages contain many Cards based on various DataSets).


Persistence of Pfilters across sessions

If you want Pfilters to expand beyond pages to also persist across sessions and refreshes, you'll need to store and load the last known state of the Pfilters. 

Malformed criteria

If a Pfilter is written incorrectly, the unfiltered version renders and a black error bar appears.

The most common reason for this is when users try to filter on columns available in the DataSet but not used in the publicly embedded content. Private embed can refer to any of the columns in the DataSet whether or not they are used in the embedded Card or Story.