Using App Connect with JavaScript Functions

Not sure why it wouldn’t work with the initial value. If you want to only update a property of the existing object then try:

// get reference to variable component
var myVariable = document.getElementById(var_order).dmxComponent;
// get order object from component
var order = myVariable.get("value");
// update order
order.currentPrice = newPrice;
// set variable value with updated order object
myVariable.set("value", order);