M365 File Uploader for Gravity Flow plugin

$149.99$199.99

This plugin enables sending files from a Gravity Flow workflow to Sharepoint.

SKU: MCG_M365GSP Categories: , Tag:

Description

M365 File Uploader for Gravity Flow

If you are wanting to copy files from Gravity Flow into SharePoint, then this is the plugin for you. It has the capability to securely and seamlessly take files uploaded into a Gravity Form and send them to a location you specify within your SharePoint library when running a Gravity Flow workflow. Directory paths and filenames can all be dynamically populated using merge tag data from your gravity form.

Send files uploaded in Gravity Forms directly to Sharepoint using Gravity Flow.
Supports files generated by Gravity PDF.
Secure authentication via Microsoft Entra and Microsoft Graph.
Supports granular Sites.Selected Graph permissions.
Use merge tags for dynamic customisation of directory path names and filenames.
Set up metadata columns to add context to your files in SharePoint.

 

Minimum Requirements:

  • WordPress 6.4+
  • Gravity Forms v2.7+
  • Gravity Flow
  • PHP 8+ required (PHP5.4 not supported)

This plugin requires Gravity Forms and Gravity Flow to be installed and a valid license in order to work properly.

On this page:

M365 File Uploader for Gravity Flow provides functionality for uploading files to SharePoint as a Gravity Flow workflow step. A second plugin called Microsoft® Graph services for WordPress is also required, which provides the authentication between your website and Microsoft Graph. Both plugins will be available in the downloads section of your account page after purchase.

Microsoft® Graph services for WordPress must be set up first to provide authentication. Once this is done, the M365 File Uploader for Gravity Flow can be used to create workflow steps.

Setting up Microsoft® Graph services for WordPress

Add a secret key to wp-config.php

After uploading and activating both plugins to your site, the first step is to set up Microsoft® Graph services for WordPress. This involves adding a secret key to your wp-config.php file for encryption and security purposes.

Copy the following code and paste it into your wp-config.php file, replacing the <secret key goes here> string with your own secret key.

//Microsoft® Graph services for WordPress secret key (must be at least 16 characters long)
define('WP_MSGRAPH_VAULT_KEY', '<secret key goes here>'); 

This secret key must be at least 16 characters long, and could for example be created by using a password generator.

Once the secret key has been added, you can navigate to the setup page in the Wordpress admin console by navigating to Tools > Microsoft Graph app manager.

You will see a page that allows you create an application and enter the authentication details – the application manager.

Create an application registration in Microsoft Entra

Before proceeding any further, some setup is required in your Microsoft 365 Tenancy.

First, go to the App registrations page with the Microsoft Entra admin centre. Add a new registration, give it an appropriate name, and register the app.

You will be taken to the settings page for the application registration that was just created. Here you will find the Application (client) ID and Directory (tenant) ID that need to be copied into the Microsoft® Graph application manager.

Add application authentication details

Going back to the Microsoft® Graph application manager in Wordpress, click the button to create an application:

After clicking "Create application", a dialogue box will appear allowing you to enter a Label, a Client ID, and a Tenant ID. The label can be anything you like (e.g. SharePoint file uploader), while the Client ID and the Tenant ID must be obtained from Microsoft Entra. Enter the Application (client) ID and Directory (tenant) ID that were generated in Microsoft Entra into the appropriate fields and click "Create".

You will now be taken back to the main screen where the application is listed, showing the client and tenant IDs that were just entered. A public/private key pair will have been created in the background, which will be used to complete the authentication with Microsoft Entra. The private key is managed by the Microsoft® Graph application manager, while the public key can be downloaded.

Copy Certificate into Microsoft Entra

Download the certificate to your device, go back to the Entra admin center, and head to the Certificates and secrets page.

Click on upload certificate to add the certificate into Entra.

The certificate will now be listed and the thumbprint should match the thumbprint listed in the Microsoft® Graph application manager.

Now, when clicking on Test connection in the Microsoft® Graph application manager, a notice should show to confirm that the authentication is working.

Grant API permissions

The final step is to grant the required API permissions within Entra that will allow for files to be uploaded. Navigate to API permissions, click Add a permission and choose Microsoft Graph (make sure to choose Microsoft graph rather than the SharePoint API).

Select Application permissions, then search for "site" and a number of options will show up. For a general setup, select Sites.ReadWrite.All and click Add permissions. Alternatively, if you need to restrict the application access only to certain sites within your tenancy, select Sites.Selected (if this is something you need to implement, please contact us for further details).

On the next screen, click Grant admin consent... and click yes.

You should now see a confirmation that read and write permissions have been granted for this application. This will allow M365 File Uploader for Gravity Flow to upload files to your SharePoint site.

Key rotation (optional)

If at any point you wish to change the certificate file (e.g. for added security purposes), click on Start key rotation to generate a new key pair.

This will generate a new pending certificate that can be downloaded and added into Microsoft Entra using the same process described above.

Once the new certificate has been added into Entra, the old certificate can be deleted from Entra and removed from the Microsoft® Graph application manager by clicking Complete key rotation.

Using M365 File Uploader for Gravity Flow

Adding a workflow step

Now that the authentication is set up, we can begin creating the workflow step.

Create workflow step, give it a name, and select the step type to be Upload a file to SharePoint

This will add the SharePoint upload settings section at the bottom of the workflow page. Click Add upload to continue

First, select the Microsoft Graph application that was set up and authenticated with Microsoft Entra.

Then select the appropriate form field, SharePoint site, and document library.

Finally, enter a destination path and add any desired metadata columns. Merge tags can be used for both of these purposes. The supported merge tags are listed below. Use forward slashes to denote the folder structure of the path. Remember to click Update Step Settings at the bottom of the page to save the settings.

That's all that is required to upload a file as part of your workflow. Additional files can be uploaded as part of the same step by clicking Add upload and repeating the same process.

Merge tags

The following merge tags are available for use in the Destination path field:

{file:name} – The original file name.
{file:index} – An integer, starting with 1, which indexes files uploaded for a single field.
{file:extension} – The file extension of the original file name.
{form_id} – The Gravity Forms form ID, which is an integer.  This never changes for a given form.
{form_title} – The Gravity Forms form title.  Note that this can change over time for a given form.
{entry:id} – The Gravity Forms entry ID, which identifies the submission.
{entry:date_created} – The date the Gravity Forms entry was submitted.
{entry:date_updated} – The date the Gravity Forms entry was updated.
{entry:payment_date} – The date the payment associated with a submission was completed, if any.
{entry:payment_status} – The current status of the payment pending for a submission.
{entry:transaction_id} – A unique identifier for the payment associated with the submission, if any.
{created_by:id} – The WordPress internal numeric identifier for the submitter.
{created_by:user_login} – The WordPress username for the submitter.
{created_by:display_name} – A label, such as a person's name, for the user who submitted the entry.
{created_by:user_email} – The email address for the submitter.
{current_step:id} – The step ID for the workflow step which uploaded the file.
{plugin_description} – A description of the plugin that uploaded the file, including version details.
{file:sha256} – The SHA–256 hash of the file contents, in lowercase hexadecimal.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.