Here is a simple example that may not do what you’re asking, so let me know.
This will check the # of items in Matrix1::B and add that # of items to Matrix2::C. Then, the script will populate/re-index all items in C.
So, with this script, the # of items in Matrix2::C is only ever increasing.
def size = |Matrix1::B|.items.size |Matrix2::C|.children.create(size) |Matrix2::C|.values = 1..|Matrix2::C|.items.size
Hey Rich, a few questions:
- each time the script is run, do you want to add another batch of items based on the number of items in Matrix1::B, or is this more like “please ensure the number of items in C matches the items in B”
- For the population of the cells, are you wanting to reindex all the cells in Matrix2 each time the script is run, or only set the index for newly created values?