The CreatorCon Call for Content is officially open! Get started here.

Need help to call subflow in ui action button

Jithender123
Tera Contributor

Have created an ui action button and client callable subflow. I want to call that sub flow in ui action which I tried but didn't worked. 

 

ui action script : 

 

function onClick() {
    var gm = new GlideModal("glide_confirm_basic", true, 600);
    gm.setTitle("Test window");
    gm.setPreference("title", "Are you sure");
    gm.setPreference("onPromptComplete", function() {
        alert("You clicked on 'Ok'");
    });
    gm.setPreference("onPromptCancel", function() {
        alert("You clicked on 'Cancel'");
    });
    gm.render();
}

client callable code snippet:

 

(function() {
 
var inputs = {};
 
inputs['number'] = { // GlideRecord 
table : 'sn_si_incident', 
sys_id :  
};
 
GlideFlow.startSubflow('sn_si.password_reset_for_sir_subflow', inputs)
.then(function(execution) {
return execution.awaitCompletion();
}, errorResolver)
.then(function(completion) {
 
var status = completion.status;
 
});
 
function errorResolver(error) {
// Handle errors in error resolver
}
})();
 
so when clicked on OK on button this subflow should trigger. please help.

 

1 REPLY 1

Siddhesh Gawade
Mega Sage
Mega Sage

Hello @Jithender123 ,

Explore below Flow API documentation, I am sure you should be able to find you answer:
https://developer.servicenow.com/dev.do#!/reference/api/xanadu/server/sn_fd-namespace/ScriptableFlow...

Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.


Regards,

Siddhesh