Files
Files works with the files in your OneDrive: it lists the files in a folder, fetches a specific file (with its content or the text it contains), uploads new files, updates or deletes an existing one and creates links to share it.
Use it when a flow needs to save what it produces to OneDrive, for example a report or an attachment received by email, or when it needs to read documents your team keeps there.
When to use it
- You want to save the attachments that arrive by email to OneDrive.
- An AI agent needs to read the text of a contract or a proposal stored in OneDrive.
- You want to list the PDFs in a folder to process them one by one.
- You need to send a client a view-only link to a document.
Configuration
You need a Microsoft One Drive credential, which connects by signing in with your Microsoft account. When you create it you choose the access level: with Read you can only read; to upload, update or delete, choose Read, Create, Update and Delete. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Microsoft One Drive credential used to access your files. |
| Operation (required) | What the component does. See Operations. By default, Get Folder Files. |
| Selection Mode | How you point to the folder in Get Folder Files and Upload Files: By Selector (you pick it from a list), By Path (you type its path, for example /Documents/Invoices), By Folder Id (you type its identifier) or By URL (you paste its link). Depending on your choice, Select folder or a text field for the path, identifier or link appears. |
| Selection Mode | How you point to the file in Get File and Delete File: By Selector, By Path, By File Id or By URL. Depending on your choice, Select file or a text field for the path, identifier or link appears. In Update File the file is always picked with Select file. |
| File Type | Which files are listed: document, image, video, audio, pdf, spreadsheet, presentation, archive, code or all. By default, all. Only in Get Folder Files. |
| Download File Content | When on, each file’s content is included in the result. Off by default. In Get Folder Files and Get File. |
| Load File Content | When on, the text of each file (for example, from a PDF or a Word document) is extracted so an agent can read it. In Get Folder Files it also needs Download File Content. Off by default. In Get Folder Files and Get File. |
| File to upload | The files to upload. Connect here the output of another component that delivers files, such as an email attachment. Only in Upload Files. |
| File Id or URL | An alternative to File to upload when nothing is connected: the web address of the file you want to upload. Only in Upload Files. |
| New Name | The file’s new name. Leave it empty to keep the current one. Only in Update File. |
| New Content | The file’s new content: connect a file or a text. Leave it empty to change only the name. Only in Update File. |
| Select Item | The file you want to share. Only in Create Sharing Link. |
| Link Type | What the link allows: View, Edit or Embed (to place it in a web page). By default, View. Only in Create Sharing Link. |
| Scope | Who can use the link: Anonymous (anyone who has it) or Organization (only people in your organisation). By default, Anonymous. Only in Create Sharing Link. |
Operations
| Operation | What it does |
|---|---|
Get Folder Files | Lists the files in a folder, with their name, size, link, type and dates. It can include their content or their text. |
Get File | Fetches the details of a specific file and, if you ask for it, its content or its text. |
Upload Files | Uploads one or more files to the given folder. |
Update File | Changes the name or the content of an existing file. |
Delete File | Deletes a file. |
Create Sharing Link | Creates a link to share a file and also returns its direct download link. |
Output
The Data output returns one item for each file listed, uploaded or fetched, with its identifier, name, size, link, type and dates; with Load File Content it also includes the file’s text. Delete File and Update File return a confirmation, and Create Sharing Link returns the sharing link, the direct download link and its expiry date if it has one.
You can connect the result to an agent so it reads the documents, to an email component to send the link, or to another component that uses the files. The component can also be connected to an Agent as a tool, so the agent decides when to look for or save files. See Tool Mode.
Example
A law firm wants to save in OneDrive the signed contracts its clients send by email.
- An email component delivers the attachments of each message received.
- Add Files with the
Upload Filesoperation and the firm’s Microsoft One Drive credential. - In Selection Mode, choose
By Pathand type/Clients/Signed contracts. - Connect the attachments to File to upload.
- If you want to notify the person in charge, connect the Data output to an email component with the link to each uploaded file.
Good practices
- Turn on Load File Content only when the flow needs to read the text: with many large files, the run takes longer.
- Use
Organizationin Scope for internal documents;Anonymouscreates a link that works for anyone who receives it. Delete Filedoes not ask for confirmation. Check first withGet Filethat it is the right file.
Related components
- Folders: create, delete and share OneDrive folders.
- Search: search for files in OneDrive.
- OneDrive Webhook: start a flow when a file changes.