← Al Davies, 250 High Street

How to create a file in SharePoint with Power Automate

Add the SharePoint action "Create file". Fill in four fields: site address, folder path, file name and file content. The flow saves a new file in that library folder.

What does the Create file action do?

Microsoft describes it in one line: "Uploads a file to a SharePoint site. Make sure to pick an existing library." It adds a new file to a document library. It does not add a list item. For list items, use the separate "Create item" action.

What do you fill in on the Create file card?

All four inputs are marked required in Microsoft's connector reference, so leave none of them blank.

  1. Site Address: the site that holds the library, for example https://contoso.sharepoint.com/sites/sitename.
  2. Folder Path: it must start with an existing library. Add folders after it if needed.
  3. File Name: the name of the new file. Include the extension, such as .txt or .pdf.
  4. File Content: the content of the file. Select it from an earlier step, or type text.

How do you build a flow that creates a file?

  1. Go to make.powerautomate.com and create a cloud flow.
  2. Choose the trigger. A schedule works for daily reports. A form or list trigger works for one file per submission.
  3. Add the SharePoint action "Create file".
  4. In Site Address, pick the site.
  5. In Folder Path, pick the library or a folder inside it.
  6. In File Name, type a name with the extension. Add dynamic content, such as a date, to keep names unique.
  7. In File Content, select the content from an earlier step.
  8. Save the flow and run it once. Open the library and check the new file.

What can you use as the file content?

File Content takes binary data. Any step that returns a file body can feed it. Examples are an email attachment, a Word template that you filled in, or the output of a PDF conversion.

To save plain text, type or select the text in File Content and end the file name with .txt. For many rows of data, build the text in a Compose action first, then pass its output.

To save email attachments, see save email attachments to SharePoint. To save a Word file as PDF, see convert Word to PDF.

What happens if a file with that name already exists?

Test this with a dummy file before you rely on it. The result depends on your library settings and on the exact name. Our advice, not a Microsoft rule: put the date and time in the file name so each run makes a new name.

If you need to overwrite a file on purpose, test that case on its own. If someone has the old file open, see file is locked for shared use.

Can you create the folder first?

Yes. Put a Create new folder step ahead of Create file, then point Folder Path at the folder it just made. For a folder named after each record in a list, follow create a folder for each list item.

Why does Create file fail?

Check these three causes first:

  1. The Folder Path does not start with an existing library. Pick it from the folder picker instead of typing it.
  2. The file name has a character that SharePoint does not allow, or it is empty. Remove special characters from dynamic names.
  3. The account behind the flow's SharePoint connection cannot upload to that folder. Sign in as that account and try uploading a file by hand.

Want help with a flow that creates files?

Need a flow that writes files to a library on a schedule? I am Al Davies, and I build these for small teams through 250 High Street LLC, working remotely. A tracker is $5,000 and takes 2 weeks. Book the free first call, or browse earlier work in the portfolio.

FAQ

Does Create file need a premium license?

No. It is a standard action in the SharePoint connector.

Can Create file save to a subfolder?

Yes. Put the library first in Folder Path, then add the subfolder after it.

Is Create file the same as Create item?

No. Create file adds a file to a library. Create item adds a row to a list.

Sources