how to get display value in business rule for variable

Hafsa1
Mega Sage

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

 

Hafsa1_1-1744034274374.png

 

6 REPLIES 6

Hafsa1
Mega Sage

@Ankur Bawiskar 

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");}

@Hafsa1 

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.

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