Creating and Working With a Keyed Object Variable

Hey everyone…

I want to create a local storage variable which is a keyed object.

The index will be a number, and the value will be a boolean. The index values will be non-continous, so it may look like this:

show_help[1000] = 0
show_help[1010] = 0
show_help[1020] = 0
show_help[1130] = 0

So the structure is like a show_help object, with an integer index field and a boolean value field.

There will be around 100 non-continuous elements I want to access.

I know how to initialise this from the database and bring it into app connect. However I would prefer not to hit the database with this and instead to create it all locally on the client side.

So my questions are:

  1. How do I declare such a structure.
  2. How can I initialse all the 100 different values (which will all initialise to 0)
  3. How do I access the values within Wappler.

I’ve tried reading lots of different bits of documentation and forum posts and experimented quite a lot but I’m still not clear how to approach this!

Best wishes,
Antony.

Community Page
Last updated: