Any reason against using the skuid.events to publish an event that’ll kick off the action sequence? Via skuid.events it would just look something like this
var obj = {dollars: "1500", pennies:'abc'};<br>skuid.events.publish('hellovent',obj);
console.log(“outputs from Data Source Action”, newContext.$PreviousAction.result);
});
To pass inputs, we are setting variables in the snippet on a UI model and then merge the values into your action.
For example, we use this heavily to create custom chatter posts. So we have ‘PostChatter’ action sequence. I’ve got a UI model that captures “Message” and Parent" (set via snippet) and then calls the action sequence to create the chatter post.
Hmmm … seems intriguing. I’d like to get the best of all options where it’s an Reusable Action Sequence for declarative reasons and an Event-triggered Sequence for javascript reasons.
Yeah it’s works out well, and just to clarify the dollars/pennies were Inputs the action sequence was expecting. Just realized that I gave zero explanation for why that extra line was there…
Thanks for sharing your ideas, Matt and Chandra. Glad you have a way to get it working, Pat! Will check in with our product management team about an easier way to do this …
As of the Millau U2 Release, we adjusted the syntax of the Action Sequences run() function to have named Action Framework Inputs be the first argument that run() accepts. So as of 11.2.x release, the recommended way to do this is the following:
var namedInputs = {<br> "ZipCode": "37408",<br> "TotalPounds": 4.5<br>};<br>skuid.actionSequences.getByName("GetShippingRate").run(namedInputs);
This is the supported way to invoke Action Sequences from JavaScript by name, passing in named inputs.
@Zach sorry for the delayed response on this but this is still an issue for us. We do have the inputs setup on the action sequence. We are also passing in the namedInputs similar to the snippet example you provided.
Zach was kind enough to work with me on this issue. The critical piece of information I was missing was the syntax to refer to the the action sequence inputs in the actions tab section. So for the above e.g. you would refer to the input in the actions section as {{$Input.hello}}
As of Skuid 12, .run() supports 2 parameters as follows:
skuid.actionSequences.getByName(“WriteLogSequence”).run(namedInputs, context);where context looks like:<br alt="" name="" rel="" target="" title="" type=""value="" /><pre alt="" name="" rel="" target="" title="" type=""value="">{ row: {}, model: {} }Prior to this, both namedInputs and context were expected as the 1st parameter, so this is a change in Skuid 12 (possibly dates back to 11.2, actually). If you have a context object in your JS, this will allow your called action sequence to be context aware.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.