cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrQ
Helper V
Helper V

Add rows to a table in MS Word with standard connectors

Hey guys

 

I was wondering if anyone knows how to add rows to a table in Microsoft Word with Power Automate and standard connectors.

So far, I've managed to unzip a .docx file and replace parts of the document.xml file. However, tables are a bit special and can't be solved by a simple replace().

Whenever I would manually edit the document.xml file, I would see something like this:

 

 

            <w:tr w:rsidR="00F66D38" w:rsidRPr="00F66D38" w14:paraId="315138BB" w14:textId="77777777" w:rsidTr="00F66D38">
                <w:trPr>
                    <w:trHeight w:val="798"/>
                </w:trPr>
                <w:sdt>
                    <w:sdtPr>
                        <w:alias w:val="repeatingTable"/>
                        <w:tag w:val="repeatingTable"/>
                        <w:id w:val="24149552"/>
                        <w15:repeatingSection/>
                    </w:sdtPr>
                    <w:sdtContent>
                        <w:sdt>
                            <w:sdtPr>
                                <w:id w:val="-581138808"/>
                                <w:placeholder>
                                    <w:docPart w:val="4DA42ED8342E4DD3ABCF21A8D13529BD"/>
                                </w:placeholder>
                                <w:showingPlcHdr/>
                                <w15:repeatingSectionItem/>
                            </w:sdtPr>
                            <w:sdtContent>
                                <w:tc>
                                    <w:tcPr>
                                        <w:tcW w:w="9718" w:type="dxa"/>
                                    </w:tcPr>
                                    <w:p w14:paraId="40518F41" w14:textId="7ADCE5E5" w:rsidR="00F66D38" w:rsidRPr="00F66D38" w:rsidRDefault="00F66D38">
                                        <w:pPr>
                                            <w:rPr>
                                                <w:lang w:val="en-GB"/>
                                            </w:rPr>
                                        </w:pPr>
                                        <w:r w:rsidRPr="00F66D38">
                                            <w:rPr>
                                                <w:rStyle w:val="PlaceholderText"/>
                                                <w:lang w:val="en-GB"/>
                                            </w:rPr>
                                            <w:t xml:space="preserve">Enter any content that you want to repeat, including other content controls. You can also insert this control around table rows </w:t>
                                        </w:r>
                                        <w:proofErr w:type="gramStart"/>
                                        <w:r w:rsidRPr="00F66D38">
                                            <w:rPr>
                                                <w:rStyle w:val="PlaceholderText"/>
                                                <w:lang w:val="en-GB"/>
                                            </w:rPr>
                                            <w:t>in order to</w:t>
                                        </w:r>
                                        <w:proofErr w:type="gramEnd"/>
                                        <w:r w:rsidRPr="00F66D38">
                                            <w:rPr>
                                                <w:rStyle w:val="PlaceholderText"/>
                                                <w:lang w:val="en-GB"/>
                                            </w:rPr>
                                            <w:t xml:space="preserve"> repeat parts of a table.</w:t>
                                        </w:r>
                                    </w:p>
                                </w:tc>
                            </w:sdtContent>
                        </w:sdt>
                    </w:sdtContent>
                </w:sdt>
            </w:tr>

 

 

most likely, the "<w:tr>" indicates a starting row. If you notice, the  <w:tr...> includes some ID's like 00F66D38 which will change for each table/row whenever I add a new row manually directly in the docx file.

While manually copying/pasting the whole <w:tr> part including the same ID's in the document.xml works to add a new row, I don't think that this is the way to go (since its always changing). 

Did anyone do this already or can push me in the right direction? I'd be super interested to know about this.

Thank you and kind regards,

1 REPLY 1
AdilBIM
Frequent Visitor

There is this tutorial which by chance give example of a "table". Method is different but the objective is same. Populating a Word document with Microsoft Power Automate - Strategy 365 Limited

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,065)