web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Populate Word Template...
Power Automate
Answered

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

(2) ShareShare
ReportReport
Posted on by 4
Hi,
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.
Categories:
I have the same question (4)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @BlackSnowFlake

    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.

     

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    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

    dynamicFileSchema2.png

     

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

    dynamicFileSchema3.png

    dynamicFileSchema4.png

     

    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!

  • MatthewBrooksST Profile Picture
    24 on at

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

  • owneyjs15 Profile Picture
    6 on at

    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.

  • Community Power Platform Member Profile Picture
    on at

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

  • Community Power Platform Member Profile Picture
    on at

    @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.

  • owneyjs15 Profile Picture
    6 on at

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

  • nitintelstra Profile Picture
    5 on at

    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 .

     

    nitintelstra_0-1607671069351.png

     

     

    Thanks

     

  • virakones Profile Picture
    389 on at

    @RichFunk365 

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

  • 4evagooner Profile Picture
    2 on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard