display info message in flow designer

saini
Tera Expert

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?

3 REPLIES 3

Sukhbir Singh2
Giga Guru

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

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hitoshi Ozawa
Giga Sage
Giga Sage

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.

  1. Add a String field "Caller Department" under field Caller.find_real_file.png
  2. Make the field Read Onlyfind_real_file.png
  3. 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'
    });​
  4. 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".

find_real_file.png