how to get display value in business rule for variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 07:02 AM
I have a variable "u_currency_code" which is a choice field.
when I checked this value and displayvalue it is giving below result. seems from backend it was updated. I need to get this value in business rule or using dom manipulation. how to get it?
current.variable.u_currentcy_code="AED"
current.variable.u_currentcy_code.getDisplayValue()=null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 05:39 AM
I checked code and it has been added via client script as per client requirement.
Now I have to do some calculation based on the display value of the variables. Backend value isa same for both choice. How to get the value because in question_answer table it is just showing backend value. I need to do some DOM manipulation to get this value?
Client script
if (natureofrequest == "new_supplier" && syst == "vendor") {
g_form.addOption("currency_code", "aed_vendor", "AED-Dirham");}
else if (natureofrequest == "existing_supplier" && syst == "vendor") {
g_form.addOption("currency_code", "aed_vendor", "AED-United Arab Emirates Dirham");}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 06:26 AM
when you use addOption() you need to pass the correct choice value and choice label
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader