how to pass an array and retrieve them from script include to catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 11:15 PM
Hi,
I'm setting some values in catalog client script. I'm getting comma seperated String of sys_id. The comma seperated string I'm getting the first value I'm using to set another reference field field so how can I remove that and also the list collector field called co-owners . For it I want to initially take values from form if not empty and append it along with the sys_id I get from the script include along with it.
I know how to set value in list collector if i get the comma separated sys_id string.
currently I'm directly setting the value so its erasing any value manually added by user but I want to keep as it is and add it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 01:53 PM
Hey Akki,
can you reformulate your question? I read it few times and still cannot understand what you want to achieve.
If you get comma separated strings, you can transform it into array by SPLIT method
var myArray = myString.split(',');
when you need to get rid of the first element, you can use JavaScript SHIFT Array method
Finally, if you want to transfer it back to strings to use in list collector you can use JOIN method
var myNewString = myArray.join(',');
Hope this helps a bit