🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

How can we help you?

Find answers, tutorials, and guides to get the most out of Gravity Extra add-ons. (DEV Preview)

Gravity Forms OneDrive Integration: Step-by-Step Setup Guide

Last updated: September 16, 2026 • Author: admin
Table of Contents

The Gravity Forms OneDrive Integration Premium Add-on connects your WordPress forms directly to Microsoft OneDrive, OneDrive for Business, and SharePoint. Rather than accumulating heavy user submissions and exhausting your web hosting storage, this add-on automatically streams uploaded files straight into designated OneDrive directories with dynamic subfolder provisioning, enterprise access controls, and zero server clutter.

Large videos and design files upload reliably with the Gravity Forms large file uploads add-on.

System Requirements & Prerequisites

  • WordPress: Version 5.8 or higher
  • Gravity Forms: Version 2.5 or higher (Basic, Pro, or Elite)
  • PHP: Version 7.4, 8.0, 8.1, 8.2, or 8.3
  • Microsoft Account: Personal OneDrive, Microsoft 365 Business, or Enterprise Entra ID
  • GravityExtra License: Active license key for automated updates and premium support
Dual Connection Modes
Choose between 1-click automatic OAuth for instant setup or a custom Microsoft Azure Entra ID app for enterprise white-labeling.
Dynamic Subfolders
Organize files automatically into dynamic subfolders based on form merge tags such as user names, dates, or submission IDs.
SharePoint Shortcuts
Support for OneDrive Shortcut Folders allows uploads to sync directly into shared corporate SharePoint document libraries.
Zero Server Bloat
Stream files straight to cloud storage, keeping your web server lean, backups lightning-fast, and storage costs low.

Connecting Gravity Forms to Microsoft OneDrive

To link your WordPress environment with OneDrive, navigate to Forms → Settings → OneDrive Add-On in your WordPress dashboard. The add-on provides two flexible connection pathways depending on your organizational security requirements:

Method 1: Automatic 1-Click Connection (Recommended)

The Automatic mode is the quickest and easiest way to authenticate. It uses GravityExtra’s verified Microsoft OAuth application to safely authorize folder access without requiring manual Azure registration:

  1. Under Connection Type, select Automatic.
  2. Click the green “Click here to connect to OneDrive” button.
  3. A secure Microsoft login window will appear. Sign in with your personal or business Microsoft account and grant the requested folder permissions.
  4. Once approved, you will be redirected back to your WordPress dashboard with an active connection indicator.
Automatic 1-Click OneDrive Connection Interface
Forms → Settings → OneDrive Add-On: 1-Click Automatic Connection

Method 2: Manual Microsoft Azure App Registration (Enterprise & Multi-Tenant)

For corporate Microsoft 365 environments, internal compliance policies, or white-labeled organizational branding, you can register your own application in the Microsoft Azure Entra ID portal:

  1. Log into the Microsoft Azure Portal using your administrative credentials.
  2. Navigate to Microsoft Entra ID (formerly Azure Active Directory) → App registrations, then click New registration.
  3. Enter an application name (for example, Gravity Forms OneDrive Sync).
  4. Under Supported account types, choose “Accounts in any organizational directory (Any Microsoft Entra ID tenant – Multitenant) and personal Microsoft accounts” to maximize compatibility.
  5. Under Redirect URI, select Web and paste your OAuth Redirect URI: https://gravityextra.com/onedrive-oauth.php (or the custom URI shown on your settings page).
  6. Click Register.
Registering an application in Microsoft Azure Entra ID
Azure Portal: Setting Name, Multi-tenant Account Type, and Redirect URI

After creating your Azure app, generate the client credentials and connect your site:

  1. From the app’s Overview screen, copy the Application (client) ID.
  2. Navigate to Certificates & secrets → click New client secret. Provide a description, set an expiration period, and click Add.
  3. Immediately copy the generated Value (not Secret ID).
  4. Return to WordPress under Forms → Settings → OneDrive Add-On, select Manual mode, and paste your App Key (Client ID) and App Secret.
  5. Click Save Settings, then click “Click here to connect to OneDrive” to finalize authorization.
Manual Azure App Credentials Configuration in WordPress
Entering Custom Azure Client ID & Secret in Gravity Forms Settings

Configuring Form Feeds & Folder Architecture

Once authenticated, configure which forms should send files to your OneDrive account and how those submissions should be structured:

  1. Go to Forms and select the form you wish to configure.
  2. Click Settings → OneDrive Add-On from the form settings menu.
  3. Check the “Enable OneDrive for this form” checkbox.
  4. In the File Upload Field dropdown, choose whether to sync a specific file upload field (e.g. Resume, Identity Document) or select All File Upload Fields to process every file in the form.
  5. Under Destination Folder, choose the primary OneDrive folder where files will be delivered.
  6. Click Save Settings.
Form-Specific OneDrive Feed Settings and Folder Selection
Form Settings → OneDrive: Enabling Feed, Field Mapping, and Folder Target

Dynamic Subfolder Organization via Gravity Forms Merge Tags

Instead of dumping all submissions into a single cluttered directory, you can organize submissions dynamically using the Sub Folder field with standard Gravity Forms merge tags:

Dynamic Folder Naming Examples:

  • {Name (First):1.3}_{Name (Last):1.6} → Creates a dedicated folder per applicant (e.g. John_Smith).
  • Application_{entry_id} → Organizes files by sequential submission ID (e.g. Application_1042).
  • {Company:5}/{date_mdy} → Nests files under the submitting organization and current date.

Automated Folder Provisioning: The add-on verifies if the subfolder exists in your OneDrive destination. If the directory does not exist, it creates it on the fly via Microsoft Graph API before placing the uploaded files inside.

Working with OneDrive Shortcut Folders & SharePoint Document Libraries

The Gravity Forms OneDrive Integration Add-on provides native support for OneDrive Shortcut Folders. This allows teams to upload files directly into shared folders owned by other colleagues or centralized Microsoft SharePoint Document Libraries:

  1. Open your OneDrive or SharePoint web portal (onedrive.live.com).
  2. Navigate to Shared in the left sidebar, locate the shared corporate folder or SharePoint library, and click “Add shortcut to My files”.
  3. In your WordPress dashboard, navigate to your form’s Settings → OneDrive tab.
  4. The Destination Folder dropdown organizes available locations into two distinct groups:
    • My Folders: Your personal OneDrive directories and nested subfolders.
    • Shortcut Folders: All corporate SharePoint and shared folders added as shortcuts to your drive.
  5. Select your preferred shortcut destination. Submissions will now be synced directly into that collaborative team library!

Storage Hygiene, Data Security & Compliance

Offloading form attachments to Microsoft OneDrive delivers critical architectural and regulatory benefits for organizations handling sensitive user data:

Preventing Server Disk Depletion
Standard WordPress setups store all file uploads in wp-content/uploads/, rapidly consuming server disk quotas and bloating database backup files. By routing files to OneDrive, your WordPress hosting environment remains agile and fast.
Enterprise-Grade Microsoft Security
Files uploaded to OneDrive inherit Microsoft’s enterprise compliance protections, including TLS encryption in transit, BitLocker encryption at rest, and compliance certifications (HIPAA, SOC 2 Type II, ISO 27001, GDPR).
Automated OAuth Token Refresh
The add-on features an automated token refresh daemon that proactively renews expired OAuth access tokens via Microsoft Graph API, guaranteeing uninterrupted form processing without requiring manual re-authentication.

Conditional Routing & Email Notifications

Take advantage of Gravity Forms conditional logic and automated email confirmations to build sophisticated multi-department workflows:

  • Conditional Upload Execution: Sync files to OneDrive only when specific user conditions are met (for example, when a checkbox “Archive copy to corporate cloud” is checked, or when the submission status is marked as “Approved”).
  • Departmental Routing: Create multiple forms or separate feeds to route technical tickets to an IT SharePoint folder and job applications to an HR OneDrive repository.
  • Notification Merge Tag: Include the special merge tag {onedrive_folder} inside form notifications to provide reviewers with an instant, direct hyperlink to the submission’s target folder in their email.

Developer Filter & Hook Reference

Developers can customize and extend the behavior of the OneDrive add-on using official WordPress filter hooks:

1. Extending Supported Upload Field Types (onedriveaddon_fields_support)

By default, the add-on processes standard Gravity Forms fileupload, googledrive, and image_hopper fields. You can register custom upload field types with this filter:




functions.php
PHP

/**
 * Register additional file upload field types with OneDrive Add-on
 *
 * @param array $supported_fields Default supported field type strings
 * @return array Modified field type list
 */
add_filter( 'onedriveaddon_fields_support', function( $supported_fields ) {
    // Add custom third-party upload field types
    $supported_fields[] = 'custom_drag_drop_uploader';
    $supported_fields[] = 'signature';

    return $supported_fields;
} );

2. Formatting the OneDrive Folder Link in Notifications (gform_notification)

The plugin automatically transforms the {onedrive_folder} merge tag into a clickable link. You can further customize or wrap this URL using the standard Gravity Forms notification filter:




functions.php
PHP

/**
 * Customize notification message with rich HTML button for OneDrive folder
 */
add_filter( 'gform_notification', function( $notification, $form, $entry ) {
    if ( $notification['name'] === 'Admin Notification' ) {
        $folder_url = gform_get_meta( $entry['id'], 'onedrive_folder_url' );
        if ( ! empty( $folder_url ) ) {
            $btn_html = '';
            $notification['message'] .= $btn_html;
        }
    }
    return $notification;
}, 20, 3 );

3. Programmatically Customizing Dynamic Subfolder Names (onedriveaddon_folder_name)

Override or prefix the subfolder naming formula programmatically before directory creation in OneDrive:




functions.php
PHP

/**
 * Customize dynamic OneDrive subfolder name before creation
 */
add_filter( 'onedriveaddon_folder_name', function( $folder_name, $form, $entry ) {
    if ( $form['id'] == 3 ) {
        return 'Clients/' . sanitize_file_name( $entry['id'] . '_' . $folder_name );
    }
    return $folder_name;
}, 10, 3 );

Frequently Asked Questions & Troubleshooting

Q: What happens if our Microsoft OneDrive access token expires?

A: The add-on includes an automated background token renewal mechanism via Microsoft Graph API refresh tokens. Under normal circumstances, tokens renew seamlessly without administrative intervention. If your organization enforces mandatory password rotation or revokes app permissions, simply navigate to Forms → Settings → OneDrive Add-On and click Connect to OneDrive to refresh authorization.

Q: Why are my SharePoint or shared team folders not appearing in the folder dropdown?

A: Microsoft Graph API requires shared folders and SharePoint document libraries to be added as shortcuts inside your personal OneDrive account before third-party apps can enumerate them. Log into OneDrive via browser, open the Shared section, locate the target folder, and click “Add shortcut to My files”. Once added, reload your WordPress form settings to see the location listed under Shortcut Folders.

Q: Can users upload large files without hitting WordPress server timeout limits?

A: Yes. The add-on utilizes chunked stream upload sessions for large file transfers. However, your hosting environment must allow sufficient execution time for initial file intake. Ensure your server’s php.ini directives specify appropriate values, such as upload_max_filesize = 64M, post_max_size = 64M, and max_execution_time = 300.

Q: Are uploaded files permanently removed from my WordPress server?

A: By default, files are safely uploaded directly to OneDrive and local temporary references are cleaned up, ensuring zero storage bloat on your web hosting account. If you require local redundant copies for compliance, the add-on provides options to retain local attachments alongside your cloud backup.

Related Resources & Live Demonstration

Was this article helpful?

Let us know how we can improve our docs.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr