Remove all spin json list of elements from another spin json list


Hi Guys,

I am trying to remove list of spin json list elements from another spin json list , but it is not working and removeAll method is returning false, hw can I make it happen, below is my code:

SpinJsonNode spinJson1 = Spin.JSON("[{“age”:25},{“age”:28},{“age”:24}]");
SpinJsonNode spinJson2 = Spin.JSON("[{“age”:25},{“age”:28}]");

Finally spinJson1 return complete list of elements which does not remove anything


See below post by @thorben

So you can use


to remove a specific object



to remove element at a specific index.

or simply assign it to an empty array to clear all elements

In your case, you could iterate on elements of the second list and do

on each object


Hi Hassan,

thanks for reply but is there no other way to remove the list at once instead of looping over, i need to keep the code minimum on modeler .


I don’t think there is a way to do it in one call…