Search files/folders

📘 Definition

The "Search files/folders" action in the OneDrive category allows you to search for files and folders by name across your OneDrive storage. This action returns a list of matching items that contain the specified name in their filename, along with rich metadata such as file type, size, MIME type (for files), web URL, and download URL (for files).

This action supports pagination, meaning you can retrieve large result sets in smaller batches by using the Next Page Token, making it ideal for workflows that deal with many files or dynamic file structures.

🔑 Key Capabilities:

  • Search both files and folders by keyword.
  • Retrieve up to 1,000 matching items per request.
  • Fetch additional results using a Page Token.
  • Access detailed metadata like ID, name, size, type, and download URL (for files).
  • Useful for flows that require dynamic file discovery or automated file processing.


📌 Example Use Cases

These are common scenarios where the Search Files/Folders action is useful in automating or simplifying workflows:


  1. Finding Recently Uploaded FilesWhen a user uploads files but forgets the exact folder location, this action allows quick search by filename across the entire OneDrive — saving time and clicks.

  1. Dynamic Retrieval in Automated FlowsIn workflows where file names follow a pattern (e.g., "Invoice_July2025.pdf"), this action can retrieve matching files dynamically, based on values from previous steps.

  1. Bulk Processing Based on Name FilterSearch for all files that contain specific terms (e.g., "draft", "backup", or "temp_") and pass them into subsequent actions like delete, move, or email — useful in cleanup or maintenance flows.

  1. Audit or Review WorkflowsAutomatically find and list documents related to audits or reports (e.g., "Q3_Report") to be reviewed, archived, or shared, without manual browsing through folders.

  1. End-User Search PortalsIntegrate with user-facing interfaces (e.g., internal dashboards) where users can search OneDrive files by name — this action helps power that backend logic securely.


📥 Inputs

These input fields define how and what the action will search in OneDrive. Fill them accurately to get precise and efficient results.


  1. ConnectionThe authenticated OneDrive Business connection that gives the action access to your OneDrive files and folders. If you haven't connected yet, you'll be prompted to sign in and authorize access.

  1. File or Folder NameThis is the main search keyword.The action will look for files or folders containing this name (not case-sensitive). You can type in the name manually (e.g., report_2025) or dynamically insert a value using a token from a previous step.

  1. Max ResultsDefines how many items to return in the response.

    • Accepts values from 1 to 1,000.
    • If you expect many matches, increase this value to avoid missing results.
    • Leaving it blank may return a default number of results (implementation-dependent).

  1. Page TokenUsed for pagination — especially helpful when results exceed the max limit.

    • Leave this empty to retrieve the first page of search results.
    • If you want the next page, use the Next Page Token output from a previous run here.
    • This helps in looping over results in batches or paginated flows.


📤 Outputs

When this action runs, it returns a set of information about the files and folders found based on your search input. Below is a detailed breakdown of each output field:


  1. Next Page TokenA token value used for pagination. If there are more results beyond the maximum number you've requested (via Max Results), this token can be used to fetch the next page of data.

    • If no additional results exist, this field will be empty.

  1. Files/FoldersA list containing the metadata of each file or folder that matches your search. Each item in this list includes the following details:

    • IDA unique identifier for the file or folder. This is essential if you want to use the item in downstream actions (like download, rename, or move).

    • NameThe name of the file or folder (e.g., Project_Plan.docx, Invoices, etc.).

    • TypeIndicates whether the returned item is a "file" or a "folder". This helps you differentiate between items if you're applying further logic in your flow.

    • Web URLA OneDrive-based public or internal link to view the file or folder in the browser. Useful for logging, sharing, or embedding in emails.

    • Download URL (only for files) A direct, pre-authenticated URL that allows the file to be downloaded without any additional authentication. This is particularly useful for automation or passing file content to another system.

    • MIME Type (only for files) Specifies the file’s content format using the standard MIME type (e.g., application/pdf, image/jpeg, text/csv). Helpful when handling the file or determining supported operations.

    • Size (only for files) Represents the total file size in bytes. Can be used to filter or validate large files before processing.



🧩 Example

🔎 Scenario: Automatically Locate a Monthly Report in OneDrive

Imagine you're building an automated flow to send a monthly sales report via email. Each month, your report is uploaded to OneDrive and contains the month name in the file name (e.g., Sales_Report_July.xlsx).

Here’s how you’d use the “Search Files/Folders” action in the flow:

  1. Set up the actionAdd the “Search Files/Folders” action after your trigger (e.g., when the month ends or a button is pressed).

  2. ConnectionSelect your OneDrive business connection to access the files.

  3. File or Folder NameEnter a dynamic value like Sales_Report_{{MonthName}} using a token picker or expression. This helps you search only for files that contain the current month’s name in the title.

  4. Max ResultsSet this to a small number like 5 to limit results and optimize performance, assuming there's only one matching report.

  5. Page TokenLeave this blank on the first run — it's only needed when paginating through results (more than max results).

  6. Use the outputFrom the output list, use the Download URL or Web URL of the matching file to:

    • Attach it to an email
    • Move it to another folder
    • Log it for records
    • Trigger a PDF conversion or upload to another platform

This example helps illustrate how you can dynamically locate and work with specific files in OneDrive using a simple keyword-based search — a powerful way to eliminate manual browsing or hardcoding file paths.