how to get the label of the choice list to check the condition in email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2016 06:49 AM
hi all
i want to use label of the choice list in the email script without using the values..
thanks
hitman

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2016 06:52 AM
Hi Hitman,
I would recommend against this as labels are subject to change and ARE different in multiple languages. The purpose of the choice list value is to avoid all those headaches.
Can I ask why you are interested in doing a label comparison?
FWIW, you can get the label by using <object>.field.getDisplayValue()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2016 10:44 AM
Hi Hitman,
You can GlideRecord the table sys_choice (name = tablename, element = field name) and that will give you the Label of the field.
Please let us know if you have any questions/concerns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2016 06:22 PM
Hi Hitman,
getDisplayValue() function returns the label name of a choice list.
Suppose a choice list label is "Draft" and its value is 1 and it is in the state field of incident.Then
current,state (returns 1)
current.state.getDisplayValue() (returns Draft)
Thanks,
Mihir