Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Populate Word Template: How to use dynamic files (dynamicFileSchema)

I'm using the Premium Populate Microsoft Word Template with a PowerApps instant trigger. I want my template file name to be derived dynamically. The connector requires I pass a "dynamicFileSchema" field of type dynamic. I cannot find an example online or in documentation. Can someone please demonstrate how this works? I tried passing JSON and plain-text but it fails.
Dual Super User II
Dual Super User II


I don't think this is possible to read the template file name dynamically because the connector will need to load the template parameters for you to fill in the power automate flow so I suggest if you have multiple templates is to use a switch case based on a specific parameter to load your template.




If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here
Advocate I
Advocate I

I found a solution to this but it is quite ugly! Basically, when you add content controls to a document, under the hood, they get a number assigned to them. By using that number with a value in JSON format, I was able to get this to work using the dynamicFileSchema field. To make this slightly less ugly, I first pointed the connector to the file that I wanted to work with, thus exposing the content control fields. Then, I copied the actual name of each content control into the value. Once you have done that, click on the ellipses and peek code. This will give you the output of the number mapped to the field name:dynamicFileSchema1.png



Then switch back to the dynamic location/library/file and use the numbers in your JSON:




This was not quite the answer I was hoping for but I guess it is better than modifying the flow in each environment and having to remap all your values. I have not yet tried this with image controls or repeating controls.


I hope this helps someone as I wasted a good bit of time trying to figure this out and was not finding any answers from the old google machine!


Happy Power Automating!

Frequent Visitor

@RichFunk365 I tried it on a repeat control and did get it to work.  Thanks for the information you gave!  It works great!

How did you compose your filename? I keep getting the error "The request entity's media type 'text/plain' is not supported for this resource.

@MatthewBrooksST thanks for validating the repeater control. I have not tried that but I have been able to get images to work as well.

@owneyjs15 the file name should be straight forward but I suspect you are also using a dynamic SP location and library? If so, this is also a bit tricky. You have to use the id's for these values. You can find the id's by pointing the connector to the SP location and library you want to use and then using "peek code" to see the values. They are listed as the "source" and "drive" parameters.

I'm using a static OneDrive for business location. Only my file name is dynamic. Could you show me how you constructed your variable?

Hi Matthew,


Could you please let us know the syntax of repeating controls. Seems like some nesting is required but I am unable to fetch the id for the repeater control.


Edit : Can see the repeater control now. It was not properly added in the document template previously .








Thank you for this! Really helpful comment - sucks there is so little documentation on the dynamic word template schema 

New Member

I am new to Power Automate and I am trying to populate a dynamically derived word file. The workaround shown by @RichFunk365 is understandable. My only issue is how to compose the variable for the dynamic filename with a static SP location and library.


The trigger is "For selected file" and I want the word connector to refer dynamically to the selected file.

Advocate I
Advocate I

Hello all,

I'm also new in the area of PowerAutomate and have also directly a problem.
I have a list with a fixed naming scheme, I build these names with the help of a loop based on values of a SharePoint list and then load the corresponding Word template which I then want to fill with the data also stored in the SP list.
How do I manage to fill these 4 fields, since there are over 800 documents, it is unfortunately not an option to work with IF or switch / case and enter the numbers by hand.

The field names are the same in all documents.


Thanks for your help in advance.

best regards


Regular Visitor

Word Online does not work correctly when a table is included in the template, the data is displayed correctly if the generated document is opened in the browser but the data in the tables is incorrect when downloading it

Not applicable


If I deploy this power automate to another environment point to another SP, will the id's of SP location and library be different?

Hi! Same problem here!


I have tried to dynamically compose the file outline using compose for the array with the loop values. As you have shown in your attached image, but it still doesn't work. 






The traces of the Compose Exectution:



Populate Template Word Function:

-The dynamicFileSchema seems to be ok.... 


In the document, the table is not properly filled:






Although the result of the schema values after execution is the same, as if we did not do it with a file schema, we can see the same results as if we did it with a schema.


Traces of an execution without schema of the populate word function:



Please help!! And  Thank you in advance

Note: English is not my native language, sorry for the mistakes.



First, make sure the table in the document is in a repeater and the repeater id is -16086....., second, put the 5 merge fields in separate columns in the table row, make sure the name of the merge field you added match the property name in the JSON you passed from flow. See below:




I could solve it! Thank you very much!

The trick to solve is 





My mistake was that when I used the compose function, the beginnings of quotation marks were escaped.


Please could you consider it as a solution.


New Member

It's real shame for Microsoft that even after 2 years it is still implemented so ugly and not corrected... 

It's real shame for Microsoft that even after 2 years it is still implemented so ugly and not corrected

Helpful resources

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,869)