0

How to use setItem in a button?

I'm having difficulty using setItem to modify a JSON in a text field with a button.

I have a text field called json. It has a simple json object which is created with another button.

button code:
let newjson := {
        S: 1
    };
json := formatJSON(newjson)

What shows up in json text field:
{"S":1}

 

 

In my modify button I have:

let getJson := parseJSON(json);
setItem(getJson, "S", "new");
json := formatJSON(getJson)

 

 

All it does is empty out the field.

If I don't parseJSON() it crashes my DB.

What am I doing wrong?

1 reply

null
    • Fred
    • 1 mth ago
    • Reported - view

    I just tried it again and now it works fine. 😫