Skip to main content

onPayloadReceived

Triggered when the widget receives a special payload from the Send Code automation module in Positive User.

  • Use case: Executing remote JavaScript logic defined in your automation flows.
onPayloadReceived: function (message) {
if (typeof message === "string") {
try {
// Execute the string as code
var fn = new Function(message);
fn();
} catch (e) {
console.error("UE - error executing message:", e);
}
}
}