cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Dual Super User III
Dual Super User III

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

4 REPLIES 4
Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
Regular Visitor

Re: Populate a Microsoft Word Template with variable content controls

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

Highlighted
Regular Visitor

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!

Highlighted
Advocate I
Advocate I

Re: Populate a Microsoft Word Template with variable content controls

Hi @yashag2255
If this action in the Word Connector requires to hardcode the values for LocationDocument Library and File, in order for it to identify and load all the fields, it's not clear to me why it lets you input Dynamic Content. 

I have been trying to work around this issue: https://powerusers.microsoft.com/t5/Building-Flows/Populating-an-existing-word-document-template-wit...

I would greatly appreciate any thoughts you could have on this 🙂

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (8,046)