I have an API endpoint that I would like to be able to search for two types of values. I’m using a search with dropdown component. The search field is tied to a REST API (in this case, https://clinicaltrials.gov/api/v2/studies). There are two key/values that I want to be able to query from that search field. I obviously can get one or the other working.
Both are tied to a “search input - value” variable. Is this technically possible, or do I really need to have two different search fields to support this? When a study is selected (either by sponsor or by ID), I click that and have it populate other fields in my form.
Thanks
You can conditionally construct the fields. If you tell me more in detail what happens when, I’ll guide you
Thanks Broberto
For instance, using the “query.spons” key, I can search for a sponsor, which is very broad.
I also want to be able to search for a study ID in that field as well (if I happen to know what it is), which narrows results obviously. That would be related to the query.id key. How I have it setup now, the field only responds to the query.spons key.
When I select the study I want, I have it populate a few fields with certain data elements.
Hope this helps? I could easily solve this by having two search fields, but I’m trying to see if I can narrow this to one, with both query strings.
I think you’ll need two searches (collections) for this, as you’re searching two different entities. You could do a workaround, but it would be in my opinion a bad practice to overcomplicate it.
Yeah - that’s what I was leaning towards, but wasn’t sure if there was something “magical” that would have solved that problem. Thanks!!