Find File/Folder

🧾 Definition

The “Find File/Folder” action is used to retrieve metadata and key properties about a specific file or folder stored in a user’s OneDrive. It provides critical details such as the item’s name, ID, path, type (file or folder), access URLs, and—if it's a file—its MIME type and size.

This action is highly useful when you need to:

  • Validate the existence of a file/folder before proceeding with other actions
  • Extract file details like size or type to route logic accordingly
  • Generate direct links to files for download or sharing

It supports two ways to locate your item: by its ID or Path, and it works seamlessly with OneDrive authentication through the built-in connection. Whether you're referencing a file uploaded through a form, selected interactively, or dynamically retrieved from earlier steps in your flow, this action gives you reliable access to detailed metadata.


Example Use Cases


1. Validate File Existence Before Processing

Before performing operations like copying, moving, or reading a file, use this action to ensure the file or folder exists in the specified location.


2. Retrieve Direct Download Link

Use this action to get a direct download URL for a file (without needing further authentication) — useful when sharing files externally or sending them via email.


3. Fetch File Metadata for Logging or Auditing

Automatically pull metadata like file size, MIME type, and path to include in audit trails, reports, or logs for compliance and tracking.


4. Dynamically Select Files in a Flow

When a file is uploaded or referenced in a previous step, use this action to resolve its full details, including public URLs or MIME type, for downstream decisions.


5. Permission or Sharing Validation

By retrieving the file's web URL and path, admins can verify where a file lives and prepare for follow-up actions like permission checks or sharing configuration.



Inputs


🔌 Connection

This is the OneDrive account connection that will be used to access the file or folder.Details: Make sure the connected account has permission to view the file or folder you're trying to retrieve. If not already connected, you can establish a new connection when setting up this action.


📂 Selecting File or Folder

This field is where you specify the exact file or folder you want to find.How to provide: There are two supported methods:

1. Using OneDrive UI Picker (Recommended for Manual Setup):

Click on the OneDrive icon in the field. A popup will appear showing your OneDrive directory. From there, you can visually select the desired file or folder. This is the easiest and most intuitive option when setting the flow up manually.

2. Using ID or Path (Dynamic or Token-based setup):

If you are referencing the file or folder dynamically (e.g., from a previous step or variable), you can enter:

  • **ID format (default):**Provide a unique file/folder ID such as: 1EED600A8F0FD9A1!s75181466e59d4bacb1ec55930b932ed1 Leave “Select By Path” disabled.

  • **Path format:**Provide the full OneDrive path, such as: /drive/root:/Pictures/Screenshot 2023-05-10 125216.png Enable the “Select By Path” toggle to indicate you are using a path instead of an ID.


Select By Path

This is a toggle (ON/OFF) to tell the system how you are identifying the file/folder: by Path or ID.

  • ON: You are using a path like /drive/root:/Documents/report.xlsx.
  • OFF: You are using a OneDrive item ID.

Make sure to set this accurately to avoid lookup failures.


📤 Outputs

Below are the fields returned after successfully locating the specified file or folder. These outputs provide essential metadata that you can use in later steps of your flow.


Id

The unique identifier of the file or folder in OneDrive.Use Case: Use this ID when referencing the file/folder in future steps, such as sharing, moving, or retrieving additional data. It is especially useful when working dynamically with OneDrive content.


Name

The name of the file or folder (e.g., report.pdf, Invoices, etc.).Use Case: You can display or log this name for tracking purposes, or use it as a reference when performing operations like renaming, tagging, or listing contents.


Path

The full path of the item in OneDrive, starting from the root (e.g., /drive/root:/Projects/2024/Q2.xlsx).Use Case: Helpful for understanding where the file/folder is located in your directory structure. It can also be used to display a user-friendly reference in logs or notifications.


Type

Indicates whether the item is a file or a folder.Possible values: "file" or "folder" Use Case: You can use this output in condition branches — for example, if it's a folder, proceed to list its contents; if it's a file, download or preview it.


Web URL

A direct link to open the file or folder in the OneDrive web interface.Use Case: Use this URL to share the file with others or to create clickable links in emails or dashboards. It provides a human-friendly way to access the item directly from the browser.


Download URL (File Only)

A pre-authenticated, direct link to download the file content.Use Case: This is valuable when you want to programmatically fetch the actual file content in later steps or pass it to another system without requiring a login.


MIME Type (File Only)

The format of the file's content, defined by the MIME type (e.g., application/pdf, image/png, text/plain).Use Case: Use this to handle files differently based on their type. For instance, you might preview PDFs but process Excel files with a data parser.


Size (File Only)

The size of the file in bytes.Use Case: Can be used to verify file size limits, detect empty or oversized files, or trigger alerts if a file exceeds an expected threshold.



📘 Example

Retrieve Details of a File Uploaded via a Form

**Scenario:**You have a Zenphi form where users upload a file (e.g., a signed contract or an invoice). That file is automatically saved to your OneDrive using a previous action in the flow. You want to fetch details such as the file name, type, size, and a downloadable link so you can:

  • Store them in a Zenphi Table
  • Send the file link via email to someone for review
  • Log the upload activity

🔧 How to Set It Up:

  1. **Form Setup (Upstream):**In your flow, include a form with a file upload field. Once the form is submitted, the file is passed forward as a Zenphi File object.

  2. "Find File/Folder" Action:

    • Connection: Select your OneDrive connection.

    • **Selecting File or Folder:**Use the token picker to insert the file detail uploaded from the form. Since it’s a Zenphi file object, it may contain either a path or ID depending on how it’s saved.

      • If using a Path, enable Select by Path and provide the dynamic file path (e.g., /drive/root:/Contracts/${FileName}).
      • If using an ID, disable the path toggle and provide the file’s ID dynamically.
  3. Use Outputs:

    • Store Name, Web URL, and Size in a Zenphi Table for reporting.
    • Include the Download URL in an email notification so a legal reviewer can download the file directly.
    • Use MIME Type in a condition to check if it’s a PDF before continuing with approval routing.

This setup provides dynamic and robust access to the OneDrive file’s metadata without needing to hard-code paths or IDs, making your flow more scalable and user-friendly.