Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

how to get the values of a list type field with background script

skumar_srbh
Tera Guru

I have a list type field on the form and I am trying to get the values of field via back ground script but getting null..  can anyone help to get the value...

find_real_file.png

Thanks in advance...

5 REPLIES 5

Raghav Sharma24
Giga Patron

can you type in the script here.

var incidents = new GlideRecord('incident');
incidents.addQuery('sys_id', 'f0bdf9051b910110fa9e8515ec4bcb1d');
incidents.query();
while (incidents.next()) {

var abc = incidents.u_phone_number.getValue();
gs.info("phone no:-"+abc);
gs.info("num"+ incidents.u_phone_number.getDisplayValue().toString());

}

user this : var abc = incidents.u_phone_number;

It will return the sys_id of records

 

Murthy Ch
Giga Sage

@skumar_srbh 

Can you try this:

var incidents = new GlideRecord('incident');
incidents.addQuery('sys_id', 'f0bdf9051b910110fa9e8515ec4bcb1d');
incidents.query();
while (incidents.next()) {
gs.info("NUmbers are:"+incidents.getDisplayValue("u_phone_number"));
}
Thanks,
Murthy