logo

NJP

Get Display Value of Choice field in Client script

New article articles in ServiceNow Community · Dec 31, 2024 · article

Hello,

I have often seen this basic question about fetching display value of choice field so here is the working short solution.

If we use getValue it will show only backend value of Choice value but below code will display front end value of Choice.

function onLoad() { //Type appropriate comment here, and begin script below var storevalue = g_form.getValue('impact'); var storedisplayvalue = g_form.getOption('impact',storevalue).text; alert(storedisplayvalue); //Alert to display when form loads }

Please hit like if this solution helps.

View original source

https://www.servicenow.com/community/itsm-articles/get-display-value-of-choice-field-in-client-script/ta-p/3138681