cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pmeeks_kc
Level: Power Up

Populate a Microsoft Word Template with variable content controls

Regarding the "Populate a Microsoft Word Template" action for Flow, it would be helpful to allow the content controls to be dynamic based on the template being used. As it stands, only one DOCX template can be used per Flow. The suggested functionality would allow multiple templates to use the same Flow and would require the content controls to be read and filled at run time, not at design time. Currently, if a variable (of the template filename) is used to specify the template file, it understandably does not work, and this error results: "Cannot evaluate the parameter 'query.$.file' at design time; it is empty or has a runtime expression."

 

This will be helpful if one has 100 templates that all use basically the same data from a SharePoint list.

 

Keep up the great work!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Populate a Microsoft Word Template with variable content controls

Hey @pmeeks_kc 

 

The current Populate Word Template action from MSFT actually requires you to provide the file at the action (basically a hardcoded value) so that It can identify and load all the fields in the template for you to assign the specific values. 

 

But for dynamic ones, you can probably check out this connector from Projectum and I have recently blogged about adding repeating HTML, Picture type fields on the word template by constructing the JSON. I believe this will allow you to dynamically pass the word template file (but will fail if the placeholders or the JSON is inappropriate or not in sync with the template requirements )

https://www.bythedevs.com/post/how-to-populate-word-template-with-rich-text-image-repeating-content-...

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Populate a Microsoft Word Template with variable content controls

Hey @pmeeks_kc 

 

The current Populate Word Template action from MSFT actually requires you to provide the file at the action (basically a hardcoded value) so that It can identify and load all the fields in the template for you to assign the specific values. 

 

But for dynamic ones, you can probably check out this connector from Projectum and I have recently blogged about adding repeating HTML, Picture type fields on the word template by constructing the JSON. I believe this will allow you to dynamically pass the word template file (but will fail if the placeholders or the JSON is inappropriate or not in sync with the template requirements )

https://www.bythedevs.com/post/how-to-populate-word-template-with-rich-text-image-repeating-content-...

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

pmeeks
Level: Powered On

Re: Populate a Microsoft Word Template with variable content controls

Thanks for sharing @yashag2255 . Something exactly like that. I had also looked at Plumsail.

SierraOscar
Level: Powered On

Re: Populate a Microsoft Word Template with variable content controls

I'm with you on that @pmeeks_kc , I have a similar scenario - I'm new to this product but at the moment I have a set of template files that my flow copies to a new directory and then I want to run the Populate template on them, but I can't give that step anything but an absolute value. So I don't have a way to tell it what the folder name will be until the flow starts to run!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,954)