Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: How do I append an array to an existing array in design studio 1.5?

$
0
0

Hi Aharon,

 

You can achieve the desired result in a Global Script function via string manipulation.  Basically, you have to take the array as input, convert it to a string, append your item and then convert the string back to any array object.  Here's a Global Script example for a simple array:

 

ArrayPush.png

 

The script code is listed below to make it easier to copy and paste:

 

var myArrayString = ""; // Initialise array string

 

 

// Convert array object to array string

pArray.forEach(function(arrayItem, index) {

  myArrayString = myArrayString + arrayItem + ",";

});

 

 

myArrayString = myArrayString + pItem; // Add item to end of array string

 


return myArrayString.split(",");  // Re-create array object

 

 

Regards,

 

Mustafa.


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>