How can I extract Field values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2023 10:43 PM
How can I extract drop down field values and show them in an alert box?
Like here in the picture, how can I extract all these State field values and also in case of Reference field?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2023 10:52 PM
Hi Udbhav,
Drop-down choices will be in sys_choice table. You can filter by required table and field to get specifics.
For Reference, it will the table being referenced. What is the exact use case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2023 11:12 PM
Hi Jaspal,
Actually I was facing issue in writing script.
If I want to write -->
If (state == "in progress"){
[then do this...];
}
In if condition here, I need Field value which I am not able to extract.
If there is any better way, please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2023 11:20 PM - edited ‎11-12-2023 11:20 PM
Hi, you can write something like this:
// Get the current ticket state
var ticketState = g_form.getValue('state');
if (ticketState === 'in_progress') {
alert('The ticket is currently in progress.');
} else
alert('The ticket is not in progress.');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2023 11:04 PM - edited ‎11-12-2023 11:05 PM
Hi,
You can do something like this on a client script:
var State = g_form.getValue('state');
var stateLabel = g_form.getOption('state', State).text;
alert(stateLabel);