Using Arrays Correctly
I want to know if I am utilizing arrays correctly with this query. I want get a user and an array of information connected to them through another table. I noticed that when I try to attach a list of items to the 'users' table then I am given a blank array. I decided to query the table I wanted information from then set it equal to the blank array in the original 'users' table as such:
Best Answer
-
Hi @NWold - although this is accomplishing your goal, there is an easier and more efficient way to do this in Xano using Addons (https://docs.xano.com/working-with-data/addons)
Addons allow you to connect related data, just like you want to do here, directly in your database request function (in your example, your Get Record).
The video below is also in the documentation but will show you how can leverage Addons:
Answers
-
I did that originally, but was presented with this output:
Even though there should be data. But this method works. Am I doing the addon method wrong?
-
You might be, if you can provide more details/screenshots of how your Addon is set up and mapped this will be helpful.
-
This is how it's set up:
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