Hi
I am trying to create a flow that takes data from a file saved in Sharepoint (I've tried both a spreadsheet and List in my many attempts) and then populates a word document - this is to generate invoices.
The trigger is manual and the flow initiated by a task being completed in Teams.
The data in the Excel is structured (represented in the below image which hopefully makes sense) in such a way that I need to return multiple rows from excel to populate a single table/generate a single document in word.
As noted in the colour key below:
- Green = my notes
- Orange = Column headers
- Blue = groupings (e.g. would expect four documents to be output based on this sample). I intentionally left out AC4 in the 'Account Code' column as this will be a weekly process and not all Account Codes will appear each week

In this scenario I would expect four word documents to be generated:
- AC1 with 6 rows in the table of the document
- AC2/AC3/AC5 all with three rows in their respective/independent documents
I have created a word template with the below fields (above is condensed for illustration purposes) and have highlighted the row and selected 'Repeating Section Content Control' in Developer mode.

Specific question in relation to the template - I'm assuming it is the entire row that should be marked as repeating? Not just the Account Code field?
Summary
After many failed attempts I'm wondering if anyone can help with this??
I have managed to build a flow that generates a document for each account code listed but only takes the first row of data (N.B. Some Account Codes may genuinely only have one row of data where some have multiple).
Any help at all would be greatly appreciated!