- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 10:01 PM
Hi SysAdmin Forum
I am trying the below but am not being successful, need assistance !!
g_form.getDisplayValue('priority') not fetching displayed priority value of current open incident form's priority field
it is instead fetching the displayed incident number value of current open incident form's incident number field
Below is the code snippet that I am trying to use ->
=====
-----
Note ->
I have tried using g_form.getValue('priority') which is fetching the numerical priority value of the current open incident form's priority field
-----
I need to fetch the current incident form's priority field's displayed value and not its numerical value.
Thanks in advance for the help.
DPP
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 10:08 PM - edited 03-16-2025 10:09 PM
Hello @DPP1
getDisplayValue() is suitable for reference type field values. For example, caller field value of the incident form.
You should try below:
var priorityValue = g_form.getValue('priority'); // Gives you the numeric value (like 1, 2, 3, 4)
var priorityDisplay = g_form.getOption('priority', priorityValue).text; // Gets the display value
g_form.addInfoMessage("Priority of the incident is " + priorityDisplay);
Hope it helps!
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 10:57 PM
Hi @DPP1,
Please use:
var value = g_form.getValue('priority');
var displayValue = g_form.getOption('priority',value).text;
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 10:08 PM - edited 03-16-2025 10:09 PM
Hello @DPP1
getDisplayValue() is suitable for reference type field values. For example, caller field value of the incident form.
You should try below:
var priorityValue = g_form.getValue('priority'); // Gives you the numeric value (like 1, 2, 3, 4)
var priorityDisplay = g_form.getOption('priority', priorityValue).text; // Gets the display value
g_form.addInfoMessage("Priority of the incident is " + priorityDisplay);
Hope it helps!
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 12:05 AM
Thanks Vishal for your response with details to my query.
I would try to use the code per your update to see if it resolves the issue of my query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 10:57 PM
Hi @DPP1,
Please use:
var value = g_form.getValue('priority');
var displayValue = g_form.getOption('priority',value).text;
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 12:04 AM
Thanks Medi C for the response with details to my query.
I would try to use the code per your update to see if it resolves the issue of my query.