Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How do I copy one array (i.e. List) to another in a business rule?

Shane J
Tera Guru

I need to copy an array (List) from the Idea table to a new Project record that has another field setup exactly the same way.   A straight-up 'setValue' doesn't work.

23 REPLIES 23

Surabhi5
Kilo Contributor

Hi Shane,

That worked perfectly. Thanks for that. Another question is that if i want to get the same value displayed in the task approval notification as well, how do i do that?

 

Thanks

Surabhi

This issue is sorted as well.

Thanks for all the help Shane. Really appreciate it. 🙂

 

Thanks,

Surabhi

No problem at all.  I was going to say you should post that issue elsewhere anyway.  😉

 

Ujjwal2
Tera Contributor
You can use following code to copy Array or any JSON object

var
copiedList = new JSONParser().parse(JSON.stringify(sourceList));