Pass Record Producer variables questions and answers to Description field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 07:52 AM
Hi,
I have created a Record Producer form for our incident table. They don't want the variable editor on the Incident form, so instead to retrieve the questions and answers I suggested we pass them into the description field.
I found this script and it sort of works.
var populatedList = '';
for (v in current.variables) {
var question = current.variables[v].getQuestion();
if(question.getLabel() != '');
{
populatedList += question.getLabel() + ":" + question.getDisplayValue() + '\n';
}
}
But it is retrieving all the variables questions and answers, including those that are not answered and null fields.
Does anyone have a better script for this?
Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 03:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 08:21 AM
If it's a referenced field to sys_user table, you just have to change one line in the code
var ciGR = new GlideRecord('sys_user');
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 08:47 AM
Hi,
current.description = 'Additional details : ' + producer.description +
'\n User ID: ' + producer.user_name.getDisplayValue() +
'\n Contact Info : ' + producer.u_call_back_number.getDisplayValue();
You can try this based on your requirement.
Thanks,
Anoja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 10:26 PM
Thanks