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.
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.
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.