Deduplicate Map in For Loop

Maybe look at flatten() and / or merge()? Could look at Unable to map the value when i have nested map variable - #2 by wyardley, which may not match your use case exactly, but might provide some ideas about how to debug it. This will also show you roughly how I’ve usually used the spread operator.

If you want further help, maybe provide an example with a list of maps or objects with some actual plausible values for the structure you’re trying to create?