Changing Object in Widget and return value

Hi everybody, almost done with my googleDrawing widget. The problem I'm facing is the following. An object is passed to the widget. I can see it in the update method and it contains the json code with the specific attribute.  After I've done my drawing on the map, I'd like to save the polygon information. I have the information, so that is fine but I'm not sure now how to change the object which was passed in the beginning and returning the polygon value in this object. References only explain why specific methods are needed but but not really showing how an object is changed (and returned). Hope you can help! Kind regards Laurens
2 answers

Hi Laurens,

Updating an object is easy:

obj.set("MyAttribute","lorem ipsum");

As for returning an object, there is no such concept when it comes to widgets.

What you should do is define a microflow with a single parameter, which can be of the same entity as the enclosing data view for example. Then in your widget, call this microflow for example when a user clicks a button in your widget or every X seconds. See for documentation on calling microflows from javascript -




Works perfectly! Thanks again Andrej and Eric.