Are lists indexed starting at 0 or at 1? I have blocks to get an index from a listviewer item clicked that lines up with a list of objects and I had to set the index to “index-1” from the listviewer to index the objects correctly, but eventually as I use the app that behavior changes and indexes the object one earlier than i want.
Example: I click the second listviewer item and the blocks that set the variable “app idx” subtracts one from the listviewer index to make “app idx” 1, which indexes the second object in my list of objects. But after a few correct attempts clicking the second listviewer item selects the first object in my list of objects, without changing that block.
Indices in the list should start from 1. But due to an internal error, they can start from 0 in some cases. If your index starts at 0, then let the developers know.
thank you for the info. I found a work around that will be helpful to anyone with similar issues. Rather than setting an app variable to an index number, my list is a list of objects so I search my list for any object that contains the item clicked and set an app variable to that object. I can make any changes and insert it back to the list by doing a similar search for the object with properties equal to my current object.
@Michael_Mckenna . Can you create and share a simple example of an app that demonstrates the problem that you are seeing? That will help us diagnose the problem.
As far as we can tell indexing always starts at 1. We have some other bugs, unfortunately, that we think can make it look otherwise, though.
I had exactly the same problem with block “in list get # __” , sometimes index started at 1 and sometimes it started with 0, either on android or iOS live app. However it always “corrected” when I re-enter same index numbers starting from 1 (i.e. doing nothing new)
I solved it by replacing with block “get property from object”. Here are my current blocks, I hope it helps.
As far as I know I believe that we’ve fixed the problems that led to it appearing that list indexing sometimes started at 0 rather than 1. If you are still seeing this error, please let us know and, if possible, send us a share link to a project which displays the problem.
Please do not use the 'get property of object' block to do list indexing. The fact that that works is an artifact of our particular implementation of Lists that we might change in the future.
the issue was still happening to me a couple of days ago so apparently it was not completely fixed or my project is weird enough to recreate the problem haha.
I dont have anymore a copy of my project with the old blocks causing the problem, I just have the project with the blocks that I showed on my previous message, idk if that still helps so let me know if you still want to take a look so I can share you my project.
False alarm even with the partial solution by @actech, the indexing weird behavior happened again today. Would you like a link to my project so you can take a look?
Sure. And can you send me clear instructions on how to demonstrate the problem? Also, will this require any explicit API keys or are you using the defaults?
You are right, my method does not eliminate the indexing error, because it uses blocks in which this error is contained. Unfortunately, the indexing error for large projects has not been resolved.
When working with a list, protect against the wrong index. If there is an element under the index 0, then enter the correction for the indices. This is a bug that will exist for a very long time or forever.
I’ve been having problems with list viewer since 2 minutes ago, when I wrote this post:
if I select the last one (or if there is only 1 item), and ask the app to read the content, it says it’s empty 90% of the time.
Should this seemingly complicate solution fix it?