filters for mobile page builder

  • 2
  • Question
  • Updated 4 years ago
  • Answered
Is there a best-practice way to replicate table filters in the mobile page builder? We can do toggle filters with buttons that set the value of conditions and requery, but I'd really like a picklist-style filter. Has anyone has success with that?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Matt,  you should look into the method of creating filters by using arbitrary fields.  Here is how. 

1. Add a condition on your primary model on the field you want filtered.  Its value should be blank and it shoudl be filterable default off. 

2. Add a model to the page that "creates a new row"   Make sure it has the field that you will be using to filter.

3. Add a panel to your page with a deck where this field is exposed.  In the card properties make the card "Edit" mode.  But turn off save and cancel buttons.

4. Add a button below the field to "filter"  When it is pushed use the action framework to add these steps:  
- Activate condition you created in step 1 and set the value of the field in your current deck.    
- Query the primary model
- Set the panel where the primary model is located.

You may also want to add a reset button that deactivates the condition and requeries.

I've built a sample page that filters accounts by industry.  You can paste the XML into a new page to see what I'm talking about here.

https://github.com/skuidify/SamplePages/blob/master/pages/Mobile_Filter

Good luck!   
Photo of ddeveaux

ddeveaux

  • 1,202 Points 1k badge 2x thumb
One small piece about this is, in the description above, Rob just left out the Header which is how he activated the left panel for the filter.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Oops.  Thanks Daryl.