How to populate all items in a dataset with aggregated (Sum) data from another dataset?

Hi J.D. thank you for your response.

If I’m not mistaken, your last section sum= items[0].paymentsSum; will only populate the one item.

I am needing ALL items to be updated. What I am struggling with is how to aggregate and then loop through all items and update all items as efficiently as possible.

Eg.
Vendor 1 transactions: $10 + $10
Vendor 2 transactions: $20 + $30

I want my Vendors dataset to show in the Payments Sum column:
Vendor 1: $20
Vendor 2: $50

And for that calculation to be done all in one method.