Adding to collections inside array

Hi everyone, I need help with collections inside arrays.

This is my array:
image

I would like to add a boolean item/value to each collection - Done: true

I can’t figure out how to do that? I can create a new array variable and I know how to add values to it, but I don’t know how to add a collection.

Later on in the scenario I will be wanting to change the Done to false for some of them, and I’m not sure how to do that either.

Any help is much appreciated!

Hi @CarlaK ,

The easiest way to do this is by using the “JSON” module and creating a JSON structure. In the structure you can define what kind of data you would like to add. You can then also add new values and old value together.
When using an array, take a look at the “aggregate to JSON” if you would like to iterate over the array, and create a new array with the new json structure.

2 Likes

Thanks @Bjorn.drivn,
The JSON data structure is definitely the thing I’ve been missing and I’m going to take some time to learn all about it.

Another solution came to me while I was driving to work today… I have now created the boolean variable that I need earlier in the scenario, and so then was able to select it during the Array Aggregator that created the array that I showed in my first post.

1 Like