Save many states in one field

I want to store 20 or more states in firestore, but not have 20 veriabels, fields…
If I save it as a string “01101000101” I can read it with StrAt.
But what if I want to replace a digit?
I could save the part before and after the digit with SubStr and then connect all 3 parts again.
But that will be a bit confusing, do you know a better way? json?

Variable structure sounds like a good idea. :slight_smile:

It looks like it has no benefit instead of normal variables in this case.
I also tested arturo’s new Array Variables. But I think it is so far only possible to delete an entry at index and not replace it and I’m not sure I can store the whole array as a string.
Maybe in the future. I can still do other things until I need them.

The benefit is to store everything nicely in a single main variable without having to do string manipulation.

Like that?

You want to save the mother variable as JSON.
And when you get the jsonstring from firebase you want to parse json into the mother variable, to restore the structure

1 Like