Skip to main content

There seems to be an issue when I make calls to delete and update values in a board’s stored values.


These are what my calls look like:

await this.monday.storage.instance.deleteItem('key');

await this.monday.storage.instance.setItem('key', newVal);


The set item works fine on the first one, but after that it doesn’t update the values.

Delete item never worked. I even tried setting a value to null, but didn’t work.


Can someone help me figure this out?

Hey @amit.lzkpa


That’s a bit odd - I’d love to help you out with this. While we’re troubleshooting on our end, would you mind helping us out with some questions?



  • Would you be able to send us an example of the code/query that is causing this behavior?

  • Is this the first time the issue has occurred? If not, when did it start happening?

  • Is this happening only on one app, or all of them?

  • Similarly is this happening on one specific instance on a board, or is it more broad / widespread?


Looking forward to hearing back from you!


-Danny


I can comment from my own experience here.

DeleteItem never has worked (no errors).

SetItem only accepts/acts on truthy values, falsy values are ignored.


My workaround has been to set to ’ ’ (with one or more spaces) to delete.


It seems to be working for me now.

Not sure if any fix was patched in the interim.

Would be happy to provide a detailed sample if still needed. Let me know!


Hey @amit.lzkpa


Understood. Can you let us know if you run into this again? We’ll take a look.


-Danny


This one seems to be happening again.

Here’s a breakdown:





  1. Fetch a value for an unknown key


let res = await this.monday.storage.instance.getItem("testKey");
let storedVal = res.data.value;
console.log(storedVal);

Result:


null

matches what I expect.





  1. Store a value


let res = await this.monday.storage.instance.setItem("testKey", "foo");
console.log(res);

Result:


{
"method": "storage",
"data": {
"success": true
},
"requestId": "yp0v6030d"
}

I guess that means all ok.





  1. Retrieve the value


let res = await this.monday.storage.instance.getItem("testKey");
let storedVal = res.data.value;
console.log(storedVal);

Result:


foo

matches what I expect.





  1. Try to overwrite it


let storeVal = "bar";
let res = await this.monday.storage.instance.setItem("testKey", "bar");
console.log(res);

Result:


{
"method": "storage",
"data": {
"success": true
},
"requestId": "4sx2dcnz8"
}

Not really sure what that means.





  1. Try to fetch overwritten value.


let res = await this.monday.storage.instance.getItem("testKey");
let storedVal = res.data.value;
console.log(storedVal);

Result:


foo

I’d expected that to be bar.


Hey there @amit.lzkpa 👋


I’ve just tried to reproduce the behavior you are experiencing, and it doesn’t seem like I was able to get the same results as you have.


Here are the results I’m getting:



Here is the code I’ve been using:



Is there a chance you could provide your full code so that we could have a closer look? Perhaps we’ll be able to troubleshoot that further together 🙂


Also, just to shed more light on this, in step 4, the result you are getting is a success message, which means that the value was overwritten successfully 🙂 I hope that helps.


-Alex