Sending documents to SharePoint

Quick Tip

The ability to send file attachments (such as uploaded files and generated documents) through Microsoft Power Automate is only available to organizations on our Pro, Team and Enterprise plans.

When sending generated PDF or Word documents to SharePoint using Microsoft Power Automate, you must ensure that the name of the document contains the file type and can be accessed in the SharePoint database.

To send entry documents to SharePoint using Microsoft Power Automate:

  1. Create a new flow. Search for Cognito Forms in the services list and then select a trigger.

  2. Set HTTP as the first action, and select GET as the Method. For the URL, choose the entry document you’d like to send.

  3. Add another step using the Data Operation > Compose action. Set the Headers option as the input.

  4. Add another step, again using the Data Operation – Compose action (this step will automatically be named ‘Compose 2’). Select the Outputs option as the input.

  5. After the Outputs dynamic content token, add the following: [Content-Disposition]

  6. Add another step using the Create file action for SharePoint. For the File Name option, switch to the Expression editor and use the following function: split(outputs('Compose_2'),'"')[1]

  7. Finally, choose Body from the HTTP dynamic content options for the File Content. At this point, your flow should look something like this:

Make sure to save your flow, and submit a test entry to ensure that everything is sent correctly to SharePoint.