Skip to content

One Drive

This component lets you load files or folders from Microsoft OneDrive into your Nappai workflow.
It can pull a single file or all files in a folder, and returns the content and metadata for further processing.

⚠️ DEPRECATION WARNING

This component is deprecated and will be removed in a future version of Nappai.
Please migrate to the recommended alternative components.

How it Works

The One Drive component connects to Microsoft OneDrive using an access token that you obtain from a pre‑configured Microsoft One Drive credential.
When you run the component, it checks whether you selected a file or a folder:

  • File – The component loads that single file using the UnstructuredFileIOLoader, which reads the file’s content and extracts any text or data it contains.
  • Folder – The component loads every file inside the folder (and sub‑folders) that matches the chosen file type filter (all, document, sheet, or pdf). It does this recursively, so nested folders are also processed.

The loader returns a list of Data objects. Each object contains the file’s text (page_content) and metadata such as the file name, path, and size.
The component also provides a second output that lists the file paths that were read, packaged in a Message object.

Inputs

Input Fields

  • Upload file or select file: Choose a single file from OneDrive to load.
  • or Select folder: Choose a folder from OneDrive to load all matching files inside it.
  • File Type: Select which types of files to load. Options are all, document, sheet, or pdf.

Credential
This component requires a Microsoft One Drive credential.

  1. First, add a Microsoft One Drive credential in the Nappai credentials section.
  2. Then, select that credential in the component’s Credential field.
    The credential must contain a Client ID, Client Secret, Tenant ID, and a Microsoft OneDrive access scope.

Outputs

  • Data (method: fetch_content): A list of Data objects containing the text and metadata of each loaded file.
  • Files (method: result_file): A Message object that lists the file paths that were read.

Usage Example

  1. Add the One Drive component to your workflow.
  2. Configure the credential by selecting the Microsoft One Drive credential you created earlier.
  3. Choose a file or folder:
    • If you want to load a single PDF, click Upload file or select file, pick the PDF, and set File Type to pdf.
    • If you want to load all documents in a folder, click or Select folder, pick the folder, and set File Type to document.
  4. Connect the Data output to the next component in your workflow (e.g., a text analysis or AI model).
  5. Run the workflow. The component will fetch the files, return their content, and you can use it for further processing.
  • Google Drive Loader – Load files from Google Drive.
  • Dropbox Loader – Load files from Dropbox.
  • Azure Blob Storage Loader – Load files from Azure Blob Storage.

These components offer similar functionality for other cloud storage services.

Tips and Best Practices

  • Use the folder option when you need to process many files at once; it’s faster than loading each file individually.
  • Set the File Type filter to narrow down the files you want to load and reduce processing time.
  • Check the file size limits of the OneDrive API; very large files may need special handling.
  • Keep your credentials secure by storing them in Nappai’s credential manager and never hard‑coding them in your workflow.

Security Considerations

  • The component stores the Microsoft One Drive credential securely in Nappai’s credential store.
  • Access tokens are refreshed automatically, so you don’t need to manage them manually.
  • Ensure that only authorized users have access to the credential to prevent unauthorized data access.