How to get Display value of Choices instead of backend values in client Script?

Snow Guest
Tera Contributor
 
1 ACCEPTED SOLUTION

Hello,

Try below in your client script, it should work

var er = g_form.getValue('priority');
var es = g_form.getOption('priority',er).text;
	alert(es);
Please hit like and mark my response as correct if that helps
Regards,
Musab

View solution in original post

4 REPLIES 4

Hi @JP - Kyndryl ,

 

Some how content in the mentioned article not working for me to get a stored display value of choice field.

 

Please let me know if you have any other way to Query the choice lable.

 

ex. Lets assume user selected priority is  high or medium i need to pop a msg you selected Priority High or medium. How i can achieve it?

Hello,

Try below in your client script, it should work

var er = g_form.getValue('priority');
var es = g_form.getOption('priority',er).text;
	alert(es);
Please hit like and mark my response as correct if that helps
Regards,
Musab

Hey Thanks @Musab Rasheed,

 

This is working.... anyhow any ideal of getting with single method using g_form?

 

and why we need to add .text after using that method? actually it is supposed to get display value right ...as we are passing back end value and field ...get option method should give us back display value na? then what is the need of giving ".text" after it.?