Hi @Pekkola Jouni,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
To group receipts by ReceiptId in Azure Logic Apps, first initialize an empty GroupedReceipts object variable. Then, use a For-each loop to iterate through the array of receipt data. Inside the loop, add a Condition to check if the ReceiptId already exists as a key in the GroupedReceipts object.
If it exists, append the current item to the existing list using union(). If it doesn’t exist, create a new key-value pair where the ReceiptId is the key, and the current item is the first element in the array. After the loop completes, the GroupedReceipts variable will contain the receipts grouped by ReceiptId, and you can use this for further processing.
I hope the above provided information will helps in better understanding and solve your issue, if you have any further concerns, please feel free to reach out to us.