Skip to main content
Use SharePoint to start a flow when a file is added or changed in a folder, to work with files and folders in document libraries, and to read and write SharePoint lists. This flow adds every new contract to a contract register list. Press Run to watch it. Every trigger and node needs a SharePoint connection, signed in with OAuth or a service principal. See Connect Microsoft 365 to set one up, including how to limit a service principal to chosen sites with Sites.Selected.

Triggers

The trigger checks the folder every minute. Files already in the folder when you turn the trigger on do not start a flow. With File updated, they do once their content changes.

Nodes

The file nodes work with files and folders in document libraries. The list nodes work with SharePoint lists. The file nodes point at a file or folder through Source: Pick from SharePoint to choose it in the editor, By ID to bind an ID, or By path. A path is the site, the library, then the folders, such as Site/Documents/Reports/file.pdf. A path without a site runs in the root site. The list nodes pick a Site and a List from dropdowns. Bind a variable to Site to pass a site ID or a full site URL, which is how you reach a subsite.

Working with several list items

Bind a list to a row in Values, Set values or Match items where and the node runs once for each entry. A multi-value column takes a bound list as its whole value instead. Update and Delete write each matched item on its own. When some fail, the run fails with a message that names which items changed and which did not. Running the node again is safe: it retries the failed items.

Troubleshooting

Files already in the folder when the trigger was turned on start a flow only once their content changes, and only with File updated. Check Events: with only File created, changes to existing files are ignored. Files in subfolders start a flow only with Include subfolders on.
The trigger watches changes across the whole library, so the connection needs access to all of it, not only to the folder.
Open the trigger and pick the folder again.
Pick a smaller folder, or turn off Include subfolders.
The file is skipped. Make it smaller, or move it out of the watched folder.
Reconnect SharePoint and run the flow again. See Connect Microsoft 365.
Uploading, updating, moving, deleting and sharing need write access. Reconnect SharePoint with Read & write sites. For a service principal, see Connect Microsoft 365.
Start the path with the site’s name, then the library, then the folders, such as Finance/Documents/Reports.
By ID looks in the root site’s libraries. For a file in another site, use the picker or a path that starts with the site.
Move SharePoint File moves items within one document library. Use Read SharePoint Files and Write SharePoint File to copy a file to another library.
Give the item a New name, or move or delete the item that is already there.
Pick a file from a document library instead of a site page.
Your organisation may not allow sharing with people outside it, or they may need to be added as a guest first.
Check that the connection can read the site. A service principal limited with Sites.Selected reaches only the sites it was granted.
Check the selected Site and List. A bound site must be a site ID or a full site URL.
Update and Delete refuse to change every item in a list. Fill in ID or at least one column in Match items where.
Narrow the filters, or update or delete in batches.
Some items were written and some were not. The message lists both. Run the node again to retry the failed items. The same applies to Deleted ... of ... items.
Use an IANA time zone name, such as Europe/Madrid, in Site time zone.