How get a value of Boolean Field on table

ursnani
Giga Guru

Hi,

I have a True or false Checkbox in my custom table and when i am trying to get the value of that checkbox its not retruning anything.

can anyone please help

var ga = g_form.getBooleanValue('My field name');

var ga = g-_from.getValue('My field Nmae');

I tried both the above but returning nothing.

Cna anyone please help

Thanks

10 REPLIES 10

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

The following should work:


g_form.getValue("field-name")



It will return "true" and "false" as strings it is client side.


but it not returning anything or me



find_real_file.png


var ga = g_form.getValue('u_ordered');


alert('The value of Ordered is ', ga);


I should have also mentioned... in order for client side scripts to work the field MUST be on the form otherwise the data isn't accessible.   Please confirm that your u_ordered field is on the form.   If its not, add it and you can always hide it after you get the value in the client script if you don't want it there.


I have the field value in all my records of mu custom table