Key Value Map - on the client side?

We have been trying to develop a very simple plugin to work as a key-value map, but we only find ways to do that on the server side.
We learned that:

  • only server-side actions have returned value (no idea why that is so)
  • there is no type in bubble that could make this easy using a state of an element

    are those right?
    looking into the forum we have seen this attempt before, but it seems no one managed to do it.
    are we missing something?

No, in some cases, a solution is to just return lists that are 1:1 in their amount of items so you know that item #4 of one list is always related to item #4 in another list, sort of a mental object instead of a computerized one :yum:

1 Like

got it, this is the type of thing I keep returning to from time to time, it seems so absurdly simple, a javascript object to store values under keys … it is so simple it has a vibe of … stupidity … stupidity from my side who can’t get this done and/or a bit from bubble’s side, whose structure seems to have been made to make this impossible :laughing:

either way I want to keep exploring, it won’t hurt to know bubble’s internals deeper … but it does feel like hacking at this point we are at.

Yeah, I agree, Bubble is extremely powerful in some points that we interact with it, but in others it seems outrageously absurd to be like that, but it is because they are not allocating resources yet to the plugin editor since their last update, they will hopefully do so in the future and we will have it better then :yum:

Personally, I refrain from hacky approaches, they create avoidable extra work in a future where it will break, so depending on the context you may want to avoid this.

we do that as well, I would not have a hacky plugin in any solution that goes to production.
I would call it … a good learning insentive :laughing:
kinda when you start playing with your toys to see how they bend …
one other thing I found it to be unreasonably dumb (or perhaps it was made that way for security reasons idk) … states … can’t be read from code (correct me if I missed something here please) …
we were trying to make rules in a plugin that would simply work with states of other elements in the page, although I found the objects bubble uses to store the states, there was no way to read them through code … then later I found here in the forum that reading states through code is not possible …
but returning to the topic, I think I will try to do as you said, perhaps having an element carry lists of keys and of values there might be a way there

1 Like

managed to do it, in a simple workaroundy manner, but it is a safe one and it works, just published it under key value map variable if you want to check it, it is completely client side.

1 Like