Global storage returns same data though the key is different

I am facing an issue while using global storage that the data is returning same though the key is different. Suppose if I store a value such as,
monday.storage.setItem(‘key#clientId#446487’, ‘some data’);

Where as while retrieving
monday.storage.getItem(‘key#clientId#446487’) ; // Returning ‘some data’
monday.storage.getItem(‘key#clientId#469720’) ; // Returning ‘some data’

Ideally it should return different data for the second statement as the key is different. Any idea? @rachelatmonday
I am not sure what is missing, Can you help me with this matter. Thanks

Try testing that with “_” or similar rather than “#” as your name separators. Just a guess.

2 Likes

Thanks @dvdsmpsn It is worked. But I do not understand why failing for ‘#’. And I do not see any specific instructions in the docs as well.

1 Like

Thank you @dvdsmpsn !

@RambabuPatina I will share this with our team so that we can take it into account to maybe add some notes in our documentation :grin:

Cheers,
Matias

2 Likes

I think this has to do with the currently the way the Storage API works. If you will still like to keep #, you can encode the key and then decode it when you want to use it.
The same principle applies to storing empty strings or new lines. They might save without any errors but if you try to get back those saved values, it will return a previously saved value

2 Likes

Yeah, new lines. What a PITA. Find and replace before saving in storage :rofl:

1 Like