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:
Create a new flow. Search for Cognito Forms in the services list and then select a trigger.
Set HTTP as the first action, and select GET as the Method. For the URL, choose the entry document you’d like to send.
Add another step using the Data Operation > Compose action. Set the Headers option as the input.
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.
After the Outputs dynamic content token, add the following:
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:
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.