Cognitoforms merging attachment as pdf to automatically uplaod to SharePoint
Table of contents
- Automate Flow 1 > Upload to form as pdf to SharePoint
- Automate Flow 2 > Merge Mutliple pdf files into one pdf
In this article, it demonstrates how to automate upload forms as pdf file in sharepoints.
Encodian, Cognito Forms, Power Automate, and SharePoint has been used to achieve this goal.
Automate Flow 1 > Upload to form as pdf to SharePoint
- Go to Power Automate in your microsoft 365
-
Create a New automated cloud flow
-
Search Cognito >
when a new entry is created
orwhen entry is updated
-
Click the Box > choose the Form that you want to upload to cloud
-
Click plus button to add an action Get Document allow you to get cognito forms in pdf version as JSON format.
-
Add
Get Document
> add Entry IdEntry Document1
Get DocumentEntry Id
is the template ID in Congito forms. In the picture, it means get forms as pdf document. Since we get pdf document, we need to store into our cloud space. - Add acition
Create file
in SharePoint -
Configure the parameters of
Create file
Since this testing Cognito form has pdf attachment files, we also need to get attachments (pdf documents),Get file
is the way to get attachments. -
Add an action
Get file
from Cognito > configure as below After you chooseId
, thefor each
control will automatically appear - Add an action
Create file
to save attachments content in SharePoint
Get document
is to get form pdf
Get file
is to get form attachments
Your work flow should like this(maybe slightly different)
So far, we have finished the Section I.
Automate Flow 2 > Merge Mutliple pdf files into one pdf
-
Create a New automated cloud flow >
When a file is created in a folder
-
Add an action
Get files (proerpties only)
to get pdf meta info -
Add an
Initilize variable
to namefiles
we need to store multiple pdf info into a variable as an array to combine it. -
Add
Get file content
>identifier
for each controller will appear automactially - Add
Appened to array
to loop through all pdf documentation in a cloud folder.{ "fileName": "@{items('For_each')?['{FilenameWithExtension}']}", "fileContent": @{body('Get_file_content')} }
-
Add
Merge document array to PDF
fromEncodian App
- Add
Create file
> to store combined pdf in cloud space
Your work flow should like this(maybe slightly different)
The automate flow has been set up, test out !
References
https://support.encodian.com/hc/en-gb/articles/360014632213-Merge-document-array-to-PDF
https://blog.developer.adobe.com/merging-documents-using-microsoft-power-automate-69a68e46081b
https://learn.microsoft.com/en-us/power-automate/getting-started
https://www.cognitoforms.com/support/63/data-integration/microsoft-flow