Tip: sorting is disabled by default in queries
Hey gang, I watched this video on accessing arrays within arrays by using an index. Unfortunately, queries performed around my implementation of this pattern were not sorted by default, resulting in unpredictable behavior when "set"-ing and "get"-in by index. This (see the video) was a powerful feature, b/c of how often accessing arrays within arrays comes-up, but please be aware that for predictable usage, you likely want (like I assumed was default) queries to be sorted by ID throughout. I was overwriting adjacent and random entries by relying on the index. (you'll see "sort" under output of the query function). Apologies if this has been covered.
Comments
-
Hey @Xanoguy! 👋
Thank you so much for providing this tip for the community!
I created this GIF to showcase what you explained above:
I'll address this with the team to ensure that we provide clear information and make it more apparent that sorting is turned off by default. 😊
-
Thanks Liz. In retrospect I may have had a pretty "edge" use case, in terms of relying on a query to then use findbyindex, but glad I was able to find the option and figure out what was going on. Thx.
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