In the Queue screen we want numeric value

chandanpatra
Tera Contributor

Hi All,

 

 var recordIds = input.controller, kioskNames = [];
   // gs.addInfoMessage('List of Interaction SysIDs: ' + recordIds);
   // gs.addInfoMessage('Length of the recordIds: ' + recordIds.length);
 
    for (i = 0; i < recordIds.length; i++) {
        var grInt = new GlideRecord('interaction');
        grInt.addQuery('sys_id', recordIds[i]);
        grInt.query();
 
        while (grInt.next()) {
            var grReason = new GlideRecord('wu_m2m_location_queue_reason');
            grReason.addQuery('wu_reason.reason', grInt.short_description);
  grReason.addQuery('wu_location_queue', queueId);
            grReason.query();
 
            if (grReason.next()) {
gs.addInfoMessage(grReason.sys_id);
                var grLabel = new GlideRecord('label_entry');
                grLabel.addQuery('table_key', grReason.sys_id);
                grLabel.query();
 
                if (grLabel.next()) {
                  //  gs.addInfoMessage('For ' + grInt.short_description + ', the Kiosk Name is ' + grLabel.label.getDisplayValue().toString());
                    kioskNames.push(grLabel.label.getDisplayValue().toString());
                }
            }
        }
    }
gs.addInfoMessage("List of Kiosk Names: " + kioskNames);
}
 
The above script is working fine ,in the  var =' recordIds' series of sys_id , it may be 3 records or 7 records or 10 records anything and it will come dynamic .Array :-"kioskNames "we are getting multiple values "tech majlis , People Exp , Office Management ".
 
assume that if there 6 tech majlis records are , 3 office management and 3 people Exp. than if the first tech majlis is coming than it should display 001 , second Record tech majlis records 002 ,third tech majlis 003, fourth record Office management it should 001 , fifth Record People Exp it should display 001  , if the six record is Tech majilis than it should be  004 like this  i want to store this value (001 , 002 Like than ) display in the Queue screen .
 
Can anyone help me the code .
 
Thanks ,
3 REPLIES 3

chandanpatra
Tera Contributor

@Ankur Bawiskar  :can you help me to build the script 

@Prana Krushna  Can you help me on this script

Ankur Bawiskar
Tera Patron
Tera Patron

@chandanpatra 

sorry we are not able to get what script you require

what did you debug and what's your analysis?

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