Microsoft SharePoint#
The Microsoft SharePoint integration stores files from a Flow in a SharePoint Online document library: a PDF from the Document Generation node, a photo taken in a form, or any other file a Flow produced. It holds the credentials of one Microsoft Entra ID app registration, so they are maintained once here instead of on every Flow that uploads a file.
The platform signs in as the application, not as one of your users. No user account, mailbox or extra license is needed, and files are stored even when nobody is logged in.
Note
This integration writes to SharePoint. Microsoft SharePoint Indexing, the second SharePoint tile, is the opposite direction: it will read a library into the myBusiness.AI document store. That one is still in development.
What to set up in Azure first#
The integration needs an app registration in Microsoft Entra ID, formerly Azure Active Directory. A Global Administrator of your tenant creates it once:
- Under App registrations, create a New registration. The name is up to you, for example
mybusiness-ai-sharepoint. No redirect URI is needed. - On the Overview page, note the Application (client) ID and the Directory (tenant) ID.
- Under Certificates & secrets, create a New client secret and copy the Value immediately. It is shown only once, and the Secret ID next to it is not the secret.
- Under API permissions, add the Microsoft Graph application permission
Sites.ReadWrite.All, then click Grant admin consent. Delegated permissions do not work here, because there is no signed-in user.
Warning
A client secret expires after 24 months at the latest. When it does, every upload fails with AADSTS7000215. Note the expiry date and renew the secret before it runs out: create a second secret, enter it here, and only then delete the old one.
Configuration#
- Tenant ID: the Directory (tenant) ID of the app registration.
- Client ID: the Application (client) ID of the app registration.
- Client secret: the value of the client secret. It is stored encrypted and is never sent back to the browser.
- Drive ID: the target document library. Files are stored here unless a Flow node names a different library.
- Site ID: an alternative to the Drive ID. When only the site is given, the default library of that site is used.
Either a Drive ID or a Site ID is required, and a Flow node can override both.
Finding the Drive ID#
Both identifiers are easiest to read in the Graph Explorer, signed in with your own account.
The site first, where contoso is your tenant and Projects the site:
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/Projects
The answer contains the site ID in the form contoso.sharepoint.com,<GUID>,<GUID>. That full string, commas included, is the Site ID. The libraries of that site follow from it:
GET https://graph.microsoft.com/v1.0/sites/{SiteID}/drives
Pick the entry whose name matches your library, in a default site called Documents. Its id is the Drive ID.
Both identifiers survive a rename. Deleting a library and creating it again produces a new Drive ID, and uploads then fail with 404 itemNotFound.
Editing an existing integration#
A saved client secret does not have to be entered again to change another setting. The field shows that a value is stored; leave it unchanged to keep it, or enter a new one to replace it.
Using it in a Flow#
Add a SharePoint node and pick this integration. The credentials then stay out of the Flow. The node stores a file or reads one back, depending on the selected operation.
Storing handles the whole step in one node:
- Target folder, for example
Reports/2026/Plant North. Missing folders are created. Characters SharePoint rejects, such as a slash inside a value, are replaced so a Flow variable cannot change the target path by accident. - File name, for example
4711.pdf. Without one, the name of the file or the title of the document is used. - File or Document: what to store. A photo, an upload or a signature from a UI node, or a document from the Document Generation node. Exactly one of the two.
- Conflict behavior when the name already exists:
renamekeeps both and is the default,replaceoverwrites,failstops the node. - SharePoint columns as a JSON object, written to the new item right after the upload.
The node returns the link to the stored file, its ID, the name it was actually stored under, the path and the size. The link is useful in a following E-Mail node, so recipients get a link instead of an attachment.
Reading works the other way round: give the path of the file inside the library, and the node hands it on as a normal file variable, ready to be attached to a mail or stored on a Business Object.
Transfers are limited to 100 MB per file. A failed transfer fails the node, so the Flow can branch on it with a Logic node and notify someone instead of losing the file silently.
Note
Several photos taken in a single form field are stored one by one when the node runs inside a Table Loop over that field. The same is not possible for email attachments, where the number of attachments is fixed in the Flow.
Common errors#
| Message | Cause | Fix |
|---|---|---|
AADSTS7000215 |
The client secret is wrong or expired, or the Secret ID was entered instead of the value | Create a new secret and copy the Value column |
AADSTS700016 |
Client ID and Tenant ID do not belong together | Compare both on the Overview page of the app registration |
403 accessDenied |
Admin consent is missing, or the permission was added as delegated | Check the API permissions, the status has to be Granted |
404 itemNotFound |
Wrong Drive ID, or the library was recreated | Read the Drive ID again |
423 resourceLocked |
The target file is checked out in SharePoint | Undo the checkout, and check for required columns in the library |
See Integration Hub