Hey @Kfawcett, thanks for making me realise I only covered inputs! I just updated my Beginner’s Guide post to cover outputs too…
I’ve posted the details below for quick reference!
Best wishes,
Antony.
Passing Values Back Out - Server Side
The plugin I have been working on has server side outputs defined as follows:
To write to these, use the code:
var my_title_out, my_email_out, my_messaging_out; // lots of data processing... return {"title_out":my_title_out, "email_out":my_email_out, "messaging_out":my_messaging_out, "error_out":false};
Passing Values Back Out - Element Based Client Side
I have created a similar element based client side plugin, so it has the same outputs (or “Exposed States” in this case) defined as follows:
To write to these, use the code:
var my_title_out, my_email_out, my_messaging_out;
// lots of data processing...
instance.publishState("title_out", my_title_out);
instance.publishState("email_out", my_email_out);
instance.publishState("messaging_out", my_messaging_out);
instance.publishState("error_out", false);