view filters with multiple values in one param

By: Ian Houston | Asked: 07/17/2024
ForumsCategory: How-toview filters with multiple values in one param
Ian Houston asked 4 months ago

I am working on an application where I want or rather need too switch the A [operater] B logic to B [operater] A.  

Say I have a two column table where the fields are Category and Name.

Example entries:
fruit, apple

fruit, orange

animal, dog

animal, cat

mineral, quartz

vegetable, carrot  

When creating a list view I could use a filter to show only one category:

Category contains [get param="category"]

With the query parameter ?category=fruit my list would return:

fruit, apple

fruit, orange  

 

But I would like to be able to return more than one category with a query like ?category=fruit,mineral to return in the view:

fruit, apple

fruit, orange

mineral, quartz  

If I could flip the test to "[get param="category"] contains |[id of Category field]|" that would make the most simple and direct sense but that isn't an option.  

 

I have a hard time believing that someone hasn't come across this desire (or need) and figured it out, but I'll be darned if I can figure out the right search terms to find the answer here or in the docs.

I have simplified it a bit from the actual in my description above but it should get the point across as to what I want to do dynamically. The values for category in my actual won't be passed in the query string but rather returned from a view that prints out something like "|fruit| |mineral|" based on assignment from another form by user ids (which categories the user should be able to see).

 

Thanks in advance for any help! Even if it is a link to the place I am not finding in the docs that would give me an ah ha moment. :)

 

-Ian  

2 Answers
Victor Font answered 4 months ago
Yes you can do want you, but it will most likely require custom code and using the frm_view_order filter. 
Bobby Clapp answered 4 months ago
Could also be something made from this, depending on how the data is being collected. https://formidableforms.com/knowledgebase/frm_filter_where_val/

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right