Creating a dynamic array to populate multi select field
I have a search form that has a multi-select field for location, in this case US states. Users can select one or more. What I was considering was querying my listing table to create an array list of the states currently represented by active listings.
Example is I have 10 listings in California, 5 in Florida, 2 in Texas. The array would return California, Florida, Texas. With this I could pre populate my search form so users are less likely do have zero results returned.
I haven't taken a stab at this, but was curious as it seemed like a good idea for my project, if its possible with Xano to query the records, create the array, and serve it to my app?
Thoughts and comments welcome, and thanks in advance!
Comments
-
Hey @Forrest yup this is definitely possible in Xano with some basic filtering the By Custom Query section of Query All Records. You can easily get your results and manipulate them if needed and send them to your app front-end
-
@Michael Udinski thanks for the response, I am going to dig into it as I think it will add to my search usability. Much appreciated!
-
@Michael Udinski I looked into your suggestion above, it couldn't be easier. Thanks so much.
I ended up using a BY CUSTOM QUERY to check only published entries, then the return AGGREGATED BY applied to my table field. Now my search selection only shows options, in this case locations, where entries are published.
Thanks again!
-
Awesome!!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback