Why getDisplayValue() displaying sys_id instead of value for glide list type field?

Ankita Kolhe
Tera Contributor

Hi Community,

I have a glide list type field and I want to copy display value of that field to another field of string type.

 

I created a before- insert/update Business rule for the same with below code:

 

current.field1=current.field2.getDisplayValue();

gs.addInfoMessage(current.field1);

 

The above info message is displaying sys id instead of value.

 

Please someone help on this.

 

Thanks

30 REPLIES 30

@Ankita Kolhe 

did you try running script in background?

query 1 record from that table and try to print the display value

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

Yes @Ankur Bawiskar  , it's displaying display value from background script.

 

AnkitaKolhe_0-1735797458354.png

 

@Ankita Kolhe 

then it should work fine in your BR script as well

are you sure the record for which BR runs has "Choice value" (the display field) populate in those?

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

@Ankur Bawiskar  Yes , choice value has been already populated on all Entity Update table records.

I don't  have any idea what's the issue here. It should work fine .

@Ankita Kolhe 

I could see encryption is enabled for the List field i.e. groupings

Can you disable that and verify running the BR?

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