Copy File

📘 Definition

The Copy File action allows you to duplicate a specific file within your OneDrive environment. This is useful when you need to back up a document, reuse a file template, or relocate content to another folder while keeping the original intact.

Key capabilities include:

  • Selecting the source file either manually via OneDrive picker or dynamically using file ID/path.
  • Choosing a destination folder for the copied file, including optional renaming during the process.
  • Supporting both static and dynamic workflows by integrating with tokens and preceding actions in your Zenphi flow.

This action ensures seamless duplication of files for collaboration, archiving, or automated document management tasks in your flows.



Example Use Cases


1. Backing Up Submitted Documents

Automatically create a copy of user-submitted files from a Zenphi form into a dedicated "Backup" folder for safekeeping or auditing purposes.


2. Duplicating a Template for Processing

When starting a new automated workflow (e.g., for invoices or contracts), duplicate a standard template file to a working folder, allowing the original to remain untouched.


3. Versioning Before Update

Before modifying or annotating a document as part of an automation, make a copy and store it in a versioning folder to preserve the original version for traceability.


4. Archiving Files After Approval

Once a document (e.g., purchase order or HR form) is approved, copy it to an "Approved Archive" folder for long-term storage and compliance.



🔽 Inputs

These fields determine which file to copy, where to copy it, and what name it should have in its new location.


  1. Connection This refers to your authenticated OneDrive connection. It enables Zenphi to securely access your OneDrive environment and perform the file copy action on your behalf. You must set this up before configuring other fields.

  1. Selecting File Specify the file you want to copy. You can choose how to provide the file in one of the following ways:

    • Using OneDrive Picker: Click the OneDrive icon in the field to visually browse and select the file directly from your OneDrive.
    • Using File ID (when ‘Select By Path’ is disabled): Provide the unique file ID, such as 1EED600A8F0FD9A1!s75181466e59d4bacb1ec55930b932ed1.
    • Using File Path (when ‘Select By Path’ is enabled): Enter the full path to the file in your drive, such as /drive/root:/Documents/Report.pdf.

    Tip: If the file is coming from a previous step, use the token picker to map the output dynamically.


  1. Selecting Destination Folder Define where the copied file should be placed within OneDrive. You have multiple options to provide this value:

    • Use OneDrive Picker: Browse and select the destination folder directly.
    • Using Folder ID (when ‘Select By Path’ is disabled): Supply the folder’s unique ID.
    • Using Folder Path (when ‘Select By Path’ is enabled): Provide a full folder path, such as /drive/root:/Archives/2024/.

    💡 Leave this field blank if you want to copy the file to the root of your OneDrive.


  1. Item Name This is the name of the new copy that will be created in the destination folder. If you're copying a file, be sure to include its extension (e.g., Report_Copy.pdf). This lets you control how the new file will appear and prevents accidental name collisions.


📤 Outputs

After the action completes, it returns details about the newly copied file. You can use this information in downstream actions (e.g., sending the file, logging, saving metadata, etc.).


  1. File ID The unique identifier of the newly created (copied) file in OneDrive.This ID can be used in future actions that require a reference to this file — such as updating, sharing, moving, or downloading it.

    Tip: Store this ID in a variable if you plan to use the copied file later in your flow.



📌 Example: Archiving a Submitted Report Template

Scenario: Your team uses a Zenphi form to collect weekly status reports from team members. Each submission triggers a flow that saves the report in a "Reports > Incoming" folder in OneDrive. Now, you want to make a backup copy of the submitted file in a separate "Reports > Archive" folder for compliance and historical tracking.

How to set up the action:

  1. Add the "Copy File" action after the step that saves or retrieves the uploaded report.

  2. In Connection, select or create your OneDrive connection.

  3. In Selecting File:

    • Use the token picker to reference the ID or Path of the uploaded file from a previous action (e.g., “Upload File” or “Form Submission”).
    • Or use the OneDrive picker UI to manually choose a test file during setup.
  4. In Selecting Destination Folder:

    • Click the OneDrive icon to choose the "Reports > Archive" folder.
    • Or provide the folder Path (/drive/root:/Reports/Archive) if selecting by path.
  5. In Item Name, provide a meaningful name like:

    Weekly_Report_{SubmissionDate}.docx

    You can use tokens to make the name dynamic based on submission metadata.

  6. Save and run the flow.The selected report will be copied to the archive folder with your specified name, leaving the original in place.


This setup is useful for keeping original files intact while distributing, backing up, or processing duplicates for other purposes (e.g., auditing, emailing, versioning).