Key Value Map not taking updates?

I have a KeyValueMap that I'm using to try and display some "logging" information about how long certain things took (other queries). In my JS query that sequences the overall queries, I have this code:

  queryTimings.data.Query1 = howLongItTook;

But this does not change the value of Query1 in the data of the key value map identified by queryTimings. Why?

Hi @djmax

Sorry for the late reply here. Assigning values to objects in the model needs to be done through specific setter functions that are exposed on each object (many of them have some form of a .setValue function though this isn't always the case). The most general way to have access to a mutable object in JS queries is to use a temporary state variable which you then reference elsewhere.

Does this help at all?