How to create multiple requested item(sc_req_item) inside single request(sc_request).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 11:53 PM
Hi,
I have a requirement, where I have to create multiple requested item(sc_req_item) inside single request(sc_request) using workflow editor in ServiceNow. Please give me your suggestions for how to fix it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 12:02 AM
Hello @praveen1231
Please refer the below solution:
Please Mark My Response as Correct/Helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 01:35 AM
Hi,
My requirement is to work on workflow. Please share me your suggestions for how to fix it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 01:54 AM
Take the reference from the below code, rewrite and add that code in workflow run script activity.
var aa = current.variables.check_box;
var bb = current.variables.check_box1;
var cc = current.variables.check_box2;
var mandatoryVars = [aa,bb,cc];
var numTrue = 0;
for (var x = 0; x < mandatoryVars.length; x++) {
if (mandatoryVars[x] == 'true') {
numTrue ++;
}
}
for(var i = 0 ; i< numTrue ; i ++){
var gr = new GlideRecord('sc_req_item');
gr.initialize();
gr.cat_item = current.cat_item;
gr.request= current.request;
gr.insert();
}
If my answer helped you, kindly mark it as correct and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2023 12:03 AM