Read and update control nodes
Functions covered
Composition structure
Composition script
Last updated
Last updated
(function() {
return {
init: function(comp, context) {
// get control node payload as array of key-value pairs
const payload = comp.getPayload();
console.log(payload);
// get control node payload as JSON object
const payload2 = comp.getPayload2();
console.log(payload2);
// set new control node payload
const newPayload = {
"Title": "New title",
"Subtitle": "New subtitle line 1\nNew subtitle line 2",
"Station Logo": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
};
comp.setPayload(newPayload);
},
close: function(comp, context) {}
};
})();