Search multiple tables at once

Is there a way to search multiple tables at once?  We have pages that have models for various objects, and I would like to be able to enter text in a single search box, and have all of the tables filtered for that same search string.

You could put a filterable default off condition on each model then have the select actions of the search component activate and set the value of those conditions then requery the models.

Hi Jared. You might be able to make use of the Filter Set for this. Here’s our documentation for this component: https://docs.skuid.com/latest/en/skuid/components/filter-set/index.html

Also, if you have a need to requery a model whenever another model is changed, that’s possible through model actions. For example, if Model A’s condition is activated or changed, or if Model A is requeried, you can set that up as a trigger to requery model B, C, D, etc. Or, it can take other actions, like activate a condition on Model B, C, or D. In other words, model actions can be a good way to interconnect your models, and you can build some sophisticated solutions around this if you have the need. Here’s our documentation for this: https://docs.skuid.com/latest/en/skuid/models/model-actions.html

Thanks for the suggestion, Raymond. I took a run at this approach, but had a couple questions.

I’ve created filters that trigger filters on other models before, but not sure how to do that with just the search box.

For example, here’s how I set up the filterable condition on the model, without specifying a field hoping it would act like a wildcard. (I know, likely wishful thinking)

And here is the select action triggered by the search component:

Is there syntax that pulls the input from the search component?

I have not worked much with the filter set that Mark suggests below. It may be a better option. Regarding your question above, you need to use a standard field if you are using multiple return objects so something like {{Id}} or {{Name}}. The way the search component works, you need to select a record that is returned in the search suggestions. Then you can pass a field value like {{Name}} to a model condition.

Got this working using the search component.  Thanks for the pointers, Raymond :slight_smile:

Thanks for the suggestion, Mark.  I’ve done something similar before using table filters across multiple models, but couldn’t figure out how to get started when it was just the text search.  It’s working now, at any rate, and I appreciate the quick response!

Jared, can you explain how you got this working using the search component?  I am trying to search multiple models using a single search component, and not having much luck.  Thanks for any help you can provide.

Hi CM.  Mark’s comments below led me to my solution.  Not sure if what I did is applicable for current versions of Skuid.  I see that Mark’s links in his comment below have gone stale.  I think the key is that even if the objects are different, they will have a field type in common, such as name or user.  If I get some time tomorrow, I will upload screenshots of my (outdated) configuration in the hopes that that will be helpful for you.

@CM - Sorry it took me so long, but here are the screenshots.