Forum Academy Marketplace Showcase Pricing Features

Checking list of type against another list of type

I am using the Multidropdown Search to allows users to search for items using tags. Users add tags to the search bar (which becomes a list of Tags) and then I want to check this list against a list of tags saved to another type in my database.

I am trying to display all database entries of this type which include the list of tags in the search bar (as well as other tags, but they must have the tags present in the search bar) in a repeating group, but can’t figure out how to say ‘show entries that match all tags in the list’.

Can anyone help point me in the right direction?

Cheers

Hi there, @garypyne… I have done exactly what you described in one of my apps, and I did it by adding an advanced filter to the search and using the contains list option in the advanced filter. The appropriate performance-related caveats apply to using the advanced filter, of course, but it worked like a charm for me.

Hope this helps.

Best…
Mike

1 Like

Thanks @mikeloc,

Are you able to provide a screenshot of the arguments you used? Understand what you’re saying, and think I’m almost there. But still being asked to provide another argument.

Not sure why another argument is required, as it makes sense in that I’m just asking if one list contains in the other.

I should note that the ‘Type of content’ being used in the Multidropdown is ‘Tags’, while the repeating group type of content is ‘subscriptions’ - Not sure if this is where the issue might be.


image

I’m not sure if this configuration will make it work, but the way I went about it would have yours looking like Search for Subscriptions:filtered, and then you set up the advanced filter in the :filtered pop out. The advanced filter would be something like This Subcription's Tags contains list Multidropdown Search by adding tag's value.

Again, I’m not sure if that will work for you, but it can’t hurt to give it a shot, eh?

Best…
Mike

I’m only getting contains, no contains list, so am currently only able to check one of the tags entered.

I’ll have to keep trying here :slight_smile:

Did you select Advanced from the dropdown in the :filtered pop out? That option is all the way down at the bottom of the dropdown.

1 Like

No I hadn’t! I had selected ‘filtered’ and just though that was what you meant by advanced filter.

I now have it working with the advanced filter!!

Seems a little obscure way to do it, would make sense for contains list to be included in the standard ‘Do a search for’ filters.
Also curious what other use cases advanced filter might be used for.

Thanks @mikeloc, appreciate the help :slight_smile:

1 Like

Just be careful with advanced filters because they do the filtering on the client side, so constrain the search as much as possible so you aren’t applying the advanced filter to a huge data set.

Noted, thanks for the tip.

Can’t see what else I’d use them for. Managed to build my entire application without coming across them until now.