- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2022 11:57 PM
Hi,
I have a requirement to update the software entitlement record assigned to users using record producer. Once the updated is done I need to get the software name and the entitlement name store in a object and push it to an array. I need to trigger a notification in a table format by passing the object values from the array.
Script Include - Object:
var obj = {user: <assigned to>, entitlement: <entitlement>};
arr.push(obj);
gs.eventQueue('usr_updated',current,arr);
Email Notification Script:
var storeVal1 = event.parm1;
gs.info("Script Include - Email Script - storeVal1[0]:" + JSON.stringify(storeVal1));
I am getting the output as {} empty object.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 12:13 AM
Hi,
Try this sample scripts to print elements-
for( var i=0; i< storeVal1.length; i++){
gs.info("user: " + storeVal1[i].user + " " + " entitlement: " + storeVal1[i].entitlement);
}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 12:13 AM
Hi,
Try this sample scripts to print elements-
for( var i=0; i< storeVal1.length; i++){
gs.info("user: " + storeVal1[i].user + " " + " entitlement: " + storeVal1[i].entitlement);
}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 12:19 AM
Hi,
script shared by Sagar should help you
Please try that and share us the updates.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader