Hello everyone,
One of the big missing pieces of our plugin system is the ability to run server-side code via actions. This will enable actions to manipulate data and more importantly return data that can be used in subsequent actions, for instance to save the result (currently, client-side actions do not offer the option ‘Result of previous step’ in the Composer dropdown in subsequent actions.
We’ve been working on this for a while and are now ready to open the beta to everyone. If you create an action in a plugin, you will be able to pick ‘Server-side’ as the action type.
(note the disclaimer here, I’ll talk a bit more about this important point at the end of this post).
Once you’ve picked this type for the action, you’ll be able to define what kind of data the action should return. It should return a flat JSON object, and you need to define first the keys and types for each key/value pair. For instance, this test plugin is designed to return an object as
in other words, your code defined in the run_server
function should return an object such as, for instance,
{
keya: "sample string"
keyb: true
keyc: [12, 67, 23, 69]
}
The captions for each keys are defined to look good in the editor, the object you return should use the key names. Here is what using such an action in your app would look like
IMPORTANT: this feature is in early public beta. It will only work on the development version of your app, for the authorized test application. Please do not use this for production, the feature and the API could change at any time.
Having said that, the more feedback we get from you guys, the faster it’ll get out of beta, so let us know how this goes!!