How to get same result with List.Map

having some difficulties learn this node

By using List.Map, you’re actually forcing the input structure and the replication order because List.Map does not replicate like other nodes. Since you’re providing a function (AddItemToFront) with an input already set, you’re changing how List.Map prioritizes input replication. It probably seems like what List.Map is returning is intuitive because it’s the output you want, but it’s conveniently ignoring the intended replication order of AddItemtoFront.

You can still force this with the right list levels (@L1 for item because you want each value treated separately and @L3 for list because you want it to treat your entire input as the list to replicate) and additional lacing. However, it’s actually simpler to use AddItemToEnd because it already treats the nested list as a singular input to be replicated (you just have to iterate each item value again). It actually matches the replication order of what you ended up getting with List.Map after switching AddItemToFront to a function prioritizing the list input.

In general, I’d suggest avoiding the List.Map node as it’s basically irrelevant with the introduction of list levels. Learning how to identify the right list levels to use with a given structure is going to be way more beneficial.

3 Likes