Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to Dynamically Populate Rows in a Word Table Using Quick Parts from Power Apps?

Posted on 21 Nov 2024 03:10:38 by

Hi everyone,

I'm currently working on populating a Word template using Quick Parts to avoid premium features in Power Automate. The data source I’m working with is from Power Apps.

The challenge I'm facing is with inserting multiple rows of data into a table in the Word template. Instead of creating new rows for each data item, all the data gets merged into a single cell or row, appearing like:

data1data2data3  
 
What I want instead is for each data item to appear in its own row, like this:
data1  
data2  
data3  
 

Is it possible to achieve this using Quick Parts? If so, what would be the best approach to dynamically generate rows for each data item? Any guidance would be greatly appreciated!

Thank you!

  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 911 on 26 Nov 2024 at 00:50:08
    How to Dynamically Populate Rows in a Word Table Using Quick Parts from Power Apps?
    Quick Parts can be used with content controls to populate data in Word.
     
    In your Word template: Create a table with one row as a placeholder (e.g., with {Placeholder} or a content control like <<Data>> in the row where the dynamic data will go) Ensure the row has properly formatted cells for your data.
     
    In Power Apps, format the data as a single string with line breaks between rows. Use Char(13) or Char(10) for new lines depending on the requirements of your template.  Concat(
        YourDataSource,
        DataColumn & Char(10)  // Concatenates data with a line break for each row
    )
     
    Replace the {Placeholder} in the Word template with your Quick Part or content control and map it to the string generated by Power Apps.
     
    Word will treat line breaks (Char(10)) within the cell content as separate lines. If you need each item in a separate row: - Use a plain-text content control in the Word table. Map the content control to the Power Apps-generated string. Word will render each Char(10) (line break) as a new row when the template is populated.
     
    Use the "Populate a Microsoft Word Template" action (standard connector, not premium). Map the field corresponding to your Quick Part or content control to the formatted string from Power Apps. Save or convert the template to a PDF/Word document.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,129

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,797

Leaderboard