Working with SharePoint documents
1. Working with SharePoint documents
The flow has structured data and email addresses. But many notifications need a document - a signed contract, a purchase order, a report. This video covers finding the right file in SharePoint and including a working link in the email.2. SharePoint document libraries in a nutshell
SharePoint structures content in a tree. A site contains one or more document libraries, each of which holds files, often organized in folders. Every file has its own URL. The SharePoint connector gives you a handful of actions to navigate this tree, including Get files, Get file content, Get file metadata using path, plus a few more. The two you'll use most for our pattern are Get files (properties only) and Get file metadata using path. Pick based on whether you already know the file name.3. Matching a row to its file
The cleanest pattern for matching a row to a file is to store the file's URL or relative path on the row itself. Works the same whether the row lives in SharePoint, Dataverse, Excel, or anywhere else. The flow reads the URL from the row, passes it to Get file metadata using path, and SharePoint returns the file's metadata, including a token called Link to item. You don't need to guess a naming convention or build a fragile Filter Query to locate the file because the URL on the row is already the definitive reference. We'll work with this pattern through the rest of the chapter.4. Get file metadata using path
Get file metadata using path is the lightweight option. Pass the SharePoint site address and the file's path within the library, and the action returns metadata like filename, last modified, size, and the Link to item token. It does not download the file itself, which keeps the flow fast and the payload small. If you actually need the bytes to attach the file to an email, you'd use Get file content instead. For linking, metadata is all you need.5. Link or attach?
Linking is almost always better than attaching, and the reason is access control. A link respects SharePoint's permissions: the recipient must have access to open the document, which is the access control you want. A link also points to the current version of the file, so anything updated in SharePoint after the email was sent reflects automatically. An attachment is the opposite. It's a snapshot from when the email was sent, frozen in the recipient's inbox. It bypasses every access control. Forward the email and the attachment forwards too, with no permission check. For sensitive documents, attaching is a leak.6. The permissions trap
The other side of linking is the permissions trap. The flow sends a URL, not access. If the recipient doesn't have SharePoint permissions on the document, clicking the link lands them on the Access denied page. The fix is one of two things. Either the recipient is in a group that already has access to the library, or you use SharePoint's Share with feature ahead of time, or as part of a separate flow step. The takeaway: linking is the right pattern, but plan for permissions separately.7. Let's practice!
Match rows to files, grab the link, prefer linking over attaching. Let's have a go.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.