Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Michael Fry1
Kilo Patron

Did you know that you could trigger a subfow from a UI action and get a response back without having the page reload?

 

Most of you probably realize that you can trigger a Flow or Subflow using a script. If you look at Developers site it looks like this:

////where current is a task record with a workflow context

      var w = new Workflow();

      var context = w.startFlow(id, current, current.operation(), getVars());

 

You can build this code more quickly by clicking the three dots and selecting Create code snippet.

MichaelFry1_0-1759526285552.png

 

 

A window will appear, as shown below, displaying the snippet with your inputs and the correct formatting. The snippet is divided into a Server side and a Client-side.

MichaelFry1_1-1759526285557.png

 

Do note that client side will require an ACL of type client_callable_flow_object. That requires security_admin access to create the ACL.

Just like the server code, there are inputs and outputs but, on the client-side you can do a cool trick with the outputs.

MichaelFry1_2-1759526285560.png

 

So what’s the cool trick? If you set-up the ACL, copy this code into a UI Action, and pass in your input data (in this example application_name, short_description, and template_source_app) in the UI action and then add a gs.info(outputs) – you see the results from the flow at the top of your page without reloading the page!

 

Happy if someone tries this and provides some feedback!