Can we unflatten items to a JSON

Hey @Gowthaman_Prabhu, I can’t think of a way to perform this aggregation with the pre-built nodes, but you could use the Function node and a little bit of custom code for this your step 2 > step 3 transformation:

This workflow will return the data structure from your step 3:

image

Hope this helps :slight_smile:

For a more in-depth explanation, check out Count occurrences of each item in JSON - #15 by MutedJam. I’ve copied my existing code from there and simply removed the nested loop (which isn’t required here) and adjusted the names of your fields.