How to get field label from field name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2020 10:12 PM
For any field in a GlideRecord, what is the method used to grab the label name?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2020 10:17 PM
hey,
try to use gr.[field name].getLabel();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2020 10:23 PM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2022 04:51 AM - edited ‎12-15-2022 02:06 PM
Well, in that case iterate over the array (let's call it arrFields) and use
gr.getElement(arrFields[i]).getLabel();
If this answer was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2024 05:26 AM
Worked like a charm!