display info message in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2022 04:37 PM
when we select category as network on incident form , we need to display the department of the caller as info message? can we achieve this using flow designer?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2022 06:28 PM
No, you can't do it with flow designer.
Try doing this by a display business rule, onload or onchange client script.
Please mark my answer as correct/helpful, if it helped.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2022 08:00 PM
Hi,
Flow designer works in background i.e. asynchronous way so no way to do that
you can use onChange client script on Category and show caller's department using GlideAjax
I would suggest to start and share us if you are stuck
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2022 12:12 AM
Hi Saini,
Unfortunately, Flow Designer won't be able to display info message. It is possible to display Caller's department as follows.
It is possible to show caller's department as a field message to a Caller field but overwrite any other message on field Caller so I recommmend adding a new field of type String underneath field Caller.
- Add a String field "Caller Department" under field Caller.
- Make the field Read Only
- Create a Script Include named "UserUtil". Check "Client callable"
var UserUtil = Class.create(); UserUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, { getDepartment: function() { var user_id = this.getParameter('sysparm_user_id'); var grUser = new GlideRecord('sys_user'); if (grUser.get(user_id)) { return grUser.department.name; } return ''; }, type: 'UserUtil' });​
- Create an onChange client script on field "Caller".
function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (newValue === '') { return; } var ajax = new GlideAjax('UserUtil'); ajax.addParam('sysparm_name', 'getDepartment'); ajax.addParam('sysparm_user_id', newValue); ajax.getXMLAnswer(function(answer) { if (answer.length > 0) { g_form.setValue('u_caller_department', answer); } }); }​
Execution sample. Caller's department is displayed in field "Caller Department".