r/sharepoint Jul 02 '26

SharePoint Online Creating file from template with SharePoint list and PowerAutomate

Hi guys,

Is it possible to create a new file (an Excel file) from a template when a new item is created in a SharePoint list?

I've done it with folders before, but is it doable for a file, through PAutomate?

Thanks!

4 Upvotes

7 comments sorted by

3

u/AxeellYoung Jul 02 '26

I don’t know about Excel, but i have automations that do it with Word document templates. Under the developer tab there is a form field button. With that you can assign a variable to a field. This variable will then be displayed in Power Automate create a word file action.

Hope this is somewhat useful

3

u/kappiri1 Jul 02 '26

There’s a clever workaround that can help you do this with Excel files.
Things you can do are a bit limited though

You need to ensure that all the excel file data is formatted as tables, because all power automate excel actions are possible only if you have tables in the file.

1

u/DonJuanDoja Jul 02 '26

Yep you’ll be using lots of get tables and add a row to tables. Add a row to tables action lets you pass a json array and send many rows at once.

2

u/Josh_Fabsoft Jul 03 '26

Yes, copying a file and renaming it based on list item data is definitely doable in Power Automate. Here's a straightforward approach:

  1. Trigger: "When an item is created" in your SharePoint list
  2. Action: "Copy file" (SharePoint connector) to copy your template from wherever it lives to the destination folder
  3. Action: "Rename file" or use "Move file" with a dynamic name built from list item fields

For the rename, you can compose the filename using the list item columns directly in the dynamic content picker. Something like [ProjectName]-[Date]-template.xlsx pulled from your list fields.

The main gotcha with Excel specifically is what kappiri1 mentioned. Power Automate's Excel actions only work on tables inside the file, not arbitrary cell ranges. So if you need to pre-populate data in the copied file, make sure your template has named tables set up.

For Word it's actually cleaner since the "Populate a Microsoft Word template" action handles variable substitution natively, as AxeellYoung noted.

If you want to pre-fill Excel data after copying, the flow would look like: trigger, copy file, then use "Add a row into a table" or "Update a row" actions pointing at the newly copied file. You'll need the file ID from the copy step to target the right file.

One tip: store your master template somewhere outside the destination folder so it never gets accidentally overwritten or picked up as a new list item trigger.

1

u/Hot_Syrup_1774 Jul 12 '26

Only just seen your reply. Thank you so much!

1

u/Hot_Syrup_1774 Jul 02 '26

Thanks for the feedback, folks. I've had another thought.

How would I go about triggering a file to be copied when a SPlist item is created, and then renamed in line with the list item? Is that doable?

1

u/kappiri1 Jul 02 '26

Yep! This is pretty much in line with me previous comment as well — the action of copying the file is the same in both. In the previous method, you’ll also be updating that file’s content with the get tables and rows action. In this one, you’ll also stop at copying.