Variable updated with Run code does not work


When using a run code component to update a geo location (long, lat) I noticed that condition on data that the run code component has updated is not working correctly.

In the example under I have a condition to be true if one of the fields fetched from the device position has data. The same field is required in the web request running just after the condition.

As you can see the condition is false, but the web request is successful

There is also visible data in the devtool. I also noticed the same issue in conditions for visibility groups, but have not reproduced that today

Hello Preben,

How are you updating these values in the Run code?

Also, even if it is technically possible to write raw values to data from Run code it is not the recommended way of updating properties on an object. Instead I recommend creating an action for updating these values, and the calling that from within the Run code.
We have an example on how to do this in our docs.

Here is a small example of action with two action params being called from a Run code.


Hope this helps.

1 Like

That was a good tip, I was not aware of this possiblity in run code. Thanks!

1 Like