Mobile App local storage scope

I created an array of booleans in localStorage, and a list of containers which toggle the booleans when clicked. The goal is to change background color of containers according to toggle state. I used a ternary operator which references the boolean value in local storage thus: {{ localStorage.values[i] === true? "#0000ff55" : "#ffff0055" }} however it seems like i loses scope in this context and is not recognized. Other formulas work in the background style field using i and item, and I have been able to toggle using array comparisons with these iterator variables, but not with this particular use of i (as an index for the localStorage array.) Using localStorage this way would make the app very fast (and easy to use.) - is there something I have missed?

1 Like

Further experimentation revealed that the iterator ri rather than i works in this situation. This is unclear to me, since the event trigger for the same component uses localStorage[i] to index each element, so I expected to be able to use i to reference the same container in the background style for that container.

1 Like

Hi @dman Glad you have a solution! I haven't been able to reproduce this in mobile apps or web apps :thinking: So far, i and ri are working the same for me

Our legacy list view for web apps used ri to access nested data, but we got user feedback that it was a fairly confusing concept to get the hang of. With the launch of our new list view, we now support i and item

Since I haven't been able to reproduce the exact issue you're running into, I'm happy to take a look at a json export or screenshots!