Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to get field label from field name?

tahnalos
Kilo Sage

For any field in a GlideRecord, what is the method used to grab the label name?

Thanks

11 REPLIES 11

Thank you, sir!

Thanks

this help me!!

Vishal Khandve
Kilo Sage

Hi,

use gr[field name].getLabel();

Go through below docs.

Servicenow Docs

 

Thanks,

Vishal Khandve

Twist: I'm being fed a bunch of field names through an array, and I need to get the field labels for them.  How do I leverage getLabel to get the label from an array that is dynamically passed?