Help adding one collection to array and removing another collection

I am attempting to use the “Get a Payment” QuickBooks Online module to get the existing payment data, then add a new invoice created by the “Create Invoice” module to the payment and update the payment in Quickbooks Online.

In order to do this I need to extract the Line Array from the “Get A Payment” request (see screenshot). I then need to remove the “LineEx” collection (red box) and then extract the remaining information in the collection (green box). Lastly, I need to make add another collection using with Amount and TxnId from the “Create Invoice” module

Simplest way is to start by using an iterator to split all the items in Line. Then use aggregate to JSON and extract the items you need.

Hope this helps!