How to give display message in case form using flow designer.

Harsha1
Tera Contributor

Hello Community;

I created one flow designer. it is successfully run. But I want to show(alert/display) flow designer output in form form. So copy the code from code snippets in flow designer and then make a business rule. But this business rule not trigger.

Condition is - after, update

How to display flow designer output(resolvetime) in case form?

(function executeRule(current, previous /*null when async*/ ) {

try {
var inputs = {};
inputs['current'] = new GlideRecord(); // GlideRecord of table:
inputs['changed_fields'] = current.short_description; // Array.Object
inputs['table_name'] = 'sn_customerservice_case';
 Start Asynchronously: Uncomment to run in background.
sn_fd.FlowAPI.startFlow('sn_customerservice.predict_resolve', inputs);

// Execute Synchronously: Run in foreground.
//sn_fd.FlowAPI.executeFlow('sn_customerservice.predict_resolve', inputs);
var variable = outputs['resolve_time'];
gs.addInfoMessage("Resolution time is" + variable);
} catch (ex) {
var message = ex.getMessage();
gs.error(message +" not display message");
}


})(current, previous);

Thanks & Regards;

Harsha

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Flows are "Async" in nature means their execution is not real time and hence I doubt there is anything to inform back to user.

 

Check this link below, i guess it shows some sort of alert from Flow Designer, might help

https://community.servicenow.com/community?id=community_blog&sys_id=af1c919edb1f67406c1c02d5ca961908

-Anurag

-Anurag

Hi, Thank you for your response. I want whatever(resolve time internet type) output of flow designer it will show on case form. When I submit a case it shows display message. How can do this? Thanks & Regards Harsha.

Hi,

You can easily do it out of flow designer. 

You can easily do it via an on submit client script or via business rule that runs on insert of the record.

 

-Anurag

 

-Anurag