Dealing with drop-down list fields

Drop-down fields in forms, similar to reference fields, can have both a value, and a display value. For example, the State field on tasks-based table forms (such as the Incident form) has a set of state options with names like New, In Progress, and Resolved.

However, the actual value associated with these selection labels is a number. In fact, the State field is specifically a number data-type field. This means that despite the label that's displayed in the drop-down, if we call g_form.getValue('state'), we'll get a numerical value rather than the label we see in the form.

You can see the list of possible ...

Get Learning ServiceNow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.