Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Populated Word Template and Removing Content Control without Removing Text

(0) ShareShare
ReportReport
Posted on by 25

I'm able to populate a Word template using the Plain Text Content Control.  Once I've attempted to remove the content control in the populated Word document, the populated text is also removed.  I've searched, but I haven't found anything that explains why it's happening or how I can prevent it.  It looks like it has something to do with the text of the placeholder being replaced instead of text being actually added.  Anybody have an idea?

  • kathydev Profile Picture
    2 on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    Is your workaround still effective? If so, could you please provide more details about the typing space? When I leave it empty, it seems to remove the plain text content control for me.

     

    To prevent this, click into the plain text content control and enter a space (make sure you're not in design mode).

  • acox Profile Picture
    95 on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    Hey everyone,

     

    This is also doable with the Plumsail Documents tool. This tool makes it much easier to work with document generation. It also offers helpful features like checkboxes, conditional hiding, and more. Have a look at this article:

    Create Word document from template by populating it using Power Automate (Microsoft Flow), Azure Logic Apps, and PowerApps

     

    The solution is paid, but there is a free 30-day trial available.

  • Verified answer
    JaysYi Profile Picture
    25 on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    I believe I figured out a workaround.

    1. Add the plain text content control in the template Word document.
    2. Add the appropriate Title and Tag in the plain text content control properties.
    3. Click into the plain text content control and type a space (not in design mode).

    After Power Automates populates the template, it appears I can remove all the content controls without removing the text.  I'm not sure why it works but it seems like Power Automate was populating the placeholder text and not the actual content if I don't type something into the content control itself.

  • JaysYi Profile Picture
    25 on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    @v-wenjuan-msft ,

    Sorry for such a late reply.  But I tried your method but editing will delete everything much like removing the content control.  It seems like it's replacing the placeholder text ("Click or tap here to enter text.") instead of inserting the data from SharePoint as text.  Any more insight?

     

    Best,

    Jason

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    Hi @JaysYi ,

     

    Thanks for your further statement.

    I'm afraid that's how things work from Power Automate. Text you added by Power Automate is added to these content control rather that Word main body. Here the control works as a container, it tells the flow where to put the text.

     

    Sorry for any inconvenience caused by this design. Would you like to try settings in above response to see whether it helps you to some extent?

     

    Best regards,

    Wenjuan Zou

     

  • JaysYi Profile Picture
    25 on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    @v-wenjuan-msft to clarify:

     

    1. I've added the plain text content control to a Word template.
    2. Then used Power Automate to populate the Word template with text from SharePoint
    3. Delete the content control in the created Word document.  However, when I delete the content control, it also deletes the text that was populated.

    I'm unsure why deleting the content control will also delete the text populated by Power Automate.  It's very strange that in other projects (separate Word template), it does not behave this way (i.e., when deleting the content control the underlying text remains).  Thanks!

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Populated Word Template and Removing Content Control without Removing Text

    Hi @JaysYi ,

     

    Do you mean you add content to the plain text content control via Power Automate flow, and now you would like to remove the control but leave the text in word still?

     

    As we know we have to put a control in word template so that we can add content via Power Automate. There's no doubt.

    We can set controls to disappear when users type in their own text. Please try and see whether it meets your request:

    vwenjuanmsft_0-1680576465212.png

     

    Check this link for further details:

    About content controls - Microsoft Support

     

    Best regards,

    Wenjuan Zou

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,631 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,991 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow