- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 12:10 AM
Hello All,
After user submits the Request, I need to copy all the variables information into Description field of Catalog Task. How can i do this can anyone please help me with this.
Thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 05:33 AM
Can you try the below script. It is a onBefore Insert/Update business rule on Catalog task table
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.request_item);
set.load();
var vs = set.getFlatQuestions();
var description =''
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && vs.get(i).getDisplayValue() != 'false') {
description = description +vs.get(i).getLabel() + " : " + vs.get(i).getDisplayValue() + "\n";
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 05:33 AM
Can you try the below script. It is a onBefore Insert/Update business rule on Catalog task table
var keys = new Array();
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.request_item);
set.load();
var vs = set.getFlatQuestions();
var description =''
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && vs.get(i).getDisplayValue() != 'false') {
description = description +vs.get(i).getLabel() + " : " + vs.get(i).getDisplayValue() + "\n";
}
}
Hope this helps. Please mark the answer as correct/helpful based on impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 05:37 AM
Hi there,
This might help:
2020-04-06 Generate Catalog Item Variables summary
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hope this helps. Please mark the answer as correct/helpful based on impact.