Can you filter a table using URL parameters?

  • 1
  • Question
  • Updated 12 months ago
  • Answered
I'm trying to avoid creating different versions of the same Skuid page that each have different table filters set by default.  I was hoping to create a single page that I could pass table filters through the URL.  Is this even possible?

For example:

1.  I have Skuid page that lists my Produce Inventory that includes a filterable table.  The user can filter by Fruit Color (yellow, orange, green).    This is easily created.  

2.  On a separate "Dashboard" page I would like to have a list of all available Fruit Colors.  If the user clicked on a "Yellow", they would be taken to the Produce Inventory page with the table filter "Yellow" set automatically.  

3.  Once they are on the Produce Inventory page they change the table filters to view other Fruit Colors (again, this isn't a problem).  

How can I accomplish Step 2 so that I don't have to create multiple pages?  

Thanks!!

Gary
Photo of Gary Bailey

Gary Bailey

  • 1,628 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Gary,

You can't filter directly with URL parameters, but you can get around it with ui-only fields.

Create a ui-only field (called "colors" or some such) and set up a url/param condition on that field. Then, set up a 'field from another model" condition to point to the value of your 'colors' field.
Make sure both are set to ignore the condition if there's no value.

Then, you'll have to set your filter to deactivate that second condition when the user selects a different option.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Actually Matt,  you can pass a url that activates a filter.  Here is the format of the URL that would be passed:  

/apex/skuid__ui?page=PageName&ToggleFilterConditionName=-on-&SelectFilterConditionName=ValuePassedToCondition

Notice difference in syntax for toggle conditions and for conditions that recieve values. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Sweet! Thanks, Rob!
Photo of Gary Bailey

Gary Bailey

  • 1,628 Points 1k badge 2x thumb
I'm actually having a hard time getting this to work.  


I've got my filter set up and it is working correctly when I enter the parameter in the Skuid model builder.  However, when I try and pass the parameter through the URL, it doesn't apply the filter.  



Then I type in this URL:

https://buildrealty--skuid.na79.visual.force.com/apex/skuid__ui?page=4.1_MyProspects_child&ToggleFilterConditionContactStatus=-on-&SelectFilterConditionContactStatus=Qualified



Which gives me the above result.  

Am I missing something obvious here?  That tends to happen!


Name of Filter:  ContactStatus

Value I'm trying to pass:  "Qualified"
(Edited)
Photo of Gary Bailey

Gary Bailey

  • 1,628 Points 1k badge 2x thumb
Ok, I'm actually embarrassed that I couldn't figure it out.  Looking back on my reply, the answer is obvious.  

https://buildrealty--skuid.na79.visual.force.com/apex/skuid__ui?page=4.1_MyProspects_child&ContactStatus=Qualified

That works perfectly.