- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 04:59 AM
Hi All,
How i can store multiple values in one varible and join with comma , by current sys_id i am getting two sysid i want store two sys_id in one variable ?
in ui action var sys_id = current.sys_id;// getting two sys_id want to join in one variable
var arr = [];
var SYSID = arr.join(',');
gs.addInfoMessage(SYSID);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2021 10:11 PM
I am already responding on this thread.
So if you think I answered your original question of setting the number field with the list of RITMs selected then mark my response as correct and close this question.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 05:20 AM
Hi,
You can do something like.
var storeid='';
var storeid=storeid+','+current.sys_id;
gs.addInfoMessage(storeid);
mark Correct✅/helpful if applicable, thanks!!
Aman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 06:19 AM
thanks Aman for replying
it not working
Actually i am trying to create a record task for multiple ritm that want to store multiple sys_id into task field , field type :list, thats why wants to store multiple sys_id in one varaible .
sendCustomEmail();
function sendCustomEmail() {
// var sys_id = current.sys_id;
// current.number= sys_id;
var storeid='';
var storeid=storeid+','+current.sys_id;
gs.addInfoMessage("deb" + storeid);
var url = 'sc_task.do';
action.setRedirectURL(url);
action.setReturnURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 05:23 AM
Hi,
I'm curious to know how come current.sys_id is giving you two sys_is's?
Can you please share?
You can use
var arr = [];
arr.push(current.sys_id.toString());
var SYSID = arr.join(',');
gs.addInfoMessage(SYSID);
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2021 06:25 AM
Hi Anil,
Actually i am trying to create a record task for multiple ritm that want to store multiple sys_id into task field , field type :list, thats why wants to store multiple sys_id in one varaible .
i have add one option"Send custom email" in ritm list page in available in selected rows like delete if i select multiple rom in ritm list it will open one task record and want to store multiple ritm sysid in that form
Kindly help me, I tried with your code not working for me attach the screenshot