Create New Array From Existing Array
Options
Benedict A
Member ✭
Hi there, I'm looking for some help with the following scenario:
1. I have a variable called "All Inquiries" that is the result of a database search.
2. Now I'm trying to create new variable ("Accepted Inquiries") by searching through "All Inquiries" for records where "status" = "Accepted"
3. I'd like to be able create other variables by searching through "All Inquiries" or even "Accepted Inquiries" by applying constraints to the source list.
My preference is not to execute new database queries in order to create variables that are just a subset of my "All Inquiries" list. I suspect this is probably straightforward, but I'm missing something since I've only been on Xano a couple of days.
P.S. I've included screenshots of what this looks like when I did it in Bubble (custom states in Bubble = variables in Xano).
Step 1: Search the database and save results to a variable called "All Inquiries"
[image.png]
Step 2: Create a new list by filtering "All Inquiries" for only records with status = accepted
[image.png]
1. I have a variable called "All Inquiries" that is the result of a database search.
2. Now I'm trying to create new variable ("Accepted Inquiries") by searching through "All Inquiries" for records where "status" = "Accepted"
3. I'd like to be able create other variables by searching through "All Inquiries" or even "Accepted Inquiries" by applying constraints to the source list.
My preference is not to execute new database queries in order to create variables that are just a subset of my "All Inquiries" list. I suspect this is probably straightforward, but I'm missing something since I've only been on Xano a couple of days.
P.S. I've included screenshots of what this looks like when I did it in Bubble (custom states in Bubble = variables in Xano).
Step 1: Search the database and save results to a variable called "All Inquiries"
[image.png]
Step 2: Create a new list by filtering "All Inquiries" for only records with status = accepted
[image.png]
Comments
-
Hey - didn't we show you this during office hours this morning or is this something similar but unrelated?
-
Hi - Sean showed how to aggregate a list (group by status, then count), and then create a variable that is a sum of all the counts for all groups. I'd hoped to use the same approach to tackle this, but haven't been able to figure it out. Thanks!
-
Ok got it...
So you have
1. Query All Records from All Inquiries - this aggregates a list grouped by status with a count
2. create a variable that sums the counts for all groups
You want to next...
• create a variable that contains the records from the first Query where status = accepted
Apologies but the Bubble screenshots do not help me 😅 Your Xano DB schema and endpoint/query set up would... you can also DM me the endpoint too - that would probably be most efficient
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