Create ArrayList from array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 07:36 AM
How to create arraylist from arrays?
I have number of arrays, I want to make arraylist of this arrays and pass it this arraylist as output of an activity. Is there any way I can achieve this?
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 07:54 AM
Hi,
What exactly is the use case and what do you mean by ArrayList?
If you mean the java object ArrayList than I doubt that it is possible because direct call to the underlying java are mostly forbidden (with a few documented exceptions). In ServiceNow we code in JavaScript and not java. That means an array list would be something like this
var a = new Array();
var b = {};
var c = {};
a.push(b);
a.push(c);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2016 08:06 AM
Hi Palash,
Try this
var arraylist = array1.concat(array2,array3,array4,...);
Thanks
Adi