Get display value of reference in service portal widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 08:14 AM
Hi all,
I have a service portal widget with a reference field in the options schema that points to the Survey Questions table.
I want to get the display value of the question that is selected. options.question just returns the sysid of the question. I already tried options.question.getDisplayValue() and it doesn't work.
Any thoughts?
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2018 10:43 AM
Asukumar,
I realize this is an old question, but I found answer to this question for myself today. Figured I'd share.
Instead of getting display value from the options object, you can get the options values through the Widget Options record's widget_parameters field. JSON parse the value and then you'll have displayValues for your reference fields.
// SERVER
(function() {
var params = JSON.parse($sp.getDisplayValue('widget_parameters'));
data.question = params.question.displayValue;
})();