getValue() is returning label of a choice instead of Value

Yesh
Tera Contributor

Hi all,

I want to get the value of a choice of a field. 

Field Label: Month

Field ID: month

Field Type: Choice

var month = g_form.getValue('month');
g_form.addInfoMessage(month);

By this I am getting the 'January', but I need the value of January i.e., '1'.

How to achieve this?

Thanks,

Yesh

16 REPLIES 16

Hi,

It got resolved.

Thanks

Yesh

So what was the issue and what was the fix?

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