Script Adapter allows you to map event data from one format into another between two widgets.
The Script Adapter widget is wired between two other widgets so that it can perform a data transformation on the event payload. Using this widget, you can:
The logic is implemented with Javascript code and the returned value of the code is the outgoing event payload.
Use the following procedure to create Javascript code for a received event.
When the Script Adapter widget receives an event from a widget it is wired to, it will display the event details in the Received Event section and then run the script. The script is run as a function with a "payload" parameter which is the payload of the incoming event. You can manipulate the payload and add any type of logic that you wish. You should end your code with a return statement. The value that is returned from your custom code will be the payload of the outbound event of this widget (provided it has not been blocked). The Sent Event section displays this information.