In this modern digital age, many businesses are turning to electronic documents(pdfs) to streamline their document management workflow and improve efficiency. That being said, with electronic documents comes the need for a secure and reliable way to sign them. This is where digital signatures come in.
In this blog, we will Digitally Sign electronic documents, such as PDFs using Power Automate.
Before we begin, please make sure the prerequisites are in place:
- Power Automate subscription.
- PassportPDF Free, full, or trial subscription (Start trial).
- Appropriate privileges to create Power Automate Flows.
- Working knowledge Power Automate.
Architecture (How will our Solution work?):
- User uploads the document(pdf) to SharePoint.
- Selects a document(pdf), and imports a certificate(pfx) file and password in the SharePoint user interface
- Behind the scene we will use “PassportPDF” custom connector to Digitally Sign the PDF and write the file back to SharePoint.
You can download the Custom connector at link.
Instructions to Download the JSON file from GitHub:
- Once your click on the above link the file is open, click on the “Raw” button located in the top right corner of the file display. This will take you to a page that displays the raw JSON data.
- Right-click on the page and select “Save As” to save the file to your computer.
Don’t like to read, follow the video tutorials at:
Create your Custom connector.
- In the Power Automate portal, go to the “Data” tab and select “Custom connectors”.
Click on the “New custom connector” button and select “Import an OpenAPI file”.
Import the Swagger file by either dragging and dropping it or selecting it from your computer.
- Once the file is uploaded, Power Automate will automatically parse the Swagger file and generate a connector definition. You can also Upload the PassportPDF image.
- Click on the “Create connector” button to create your custom connector.
Now that you have created the PassPortPDF Custom Connector. Let’s start building the Flow.
- For this Tutorial, we will use “For a selected item” SharePoint Trigger action and “Add an input” of type “File” for importing the Certificate and “Text” for setting the Certificate Password.
- We use this trigger to start the Flow from SharePoint Online User Interface.
Add the “Get file (properties only)” action and configure it with reference to the details below:
- Site Address: Specify the path to the SharePoint Online site collection which holds the file.
- Library Name: Select the Library Name from the dropdown
- ID: “ID” is the output of the “For a selected file” action.
Add the “Get file content” SharePoint action and pass the “Identifier” (Output of “Get file properties” action).
Add the “Document Load” custom PassportPDF action and pass it the “File Content” (Output of “Get file Content” action).
Note: In case you are using PassPort PDF Connector for the first time, you will receive a prompt to enter the API key. You can locate the API key at the following link:
Add a Delay of “45 seconds” so that our Document completes loading.
Add the “Digi Sign” custom PassportPDF action and pass it the
- “FileId” the output of the “Document Load” action.
- “Certificate Data” and CertificatePassword” the (Output of “for selected file” trigger).
Add the “Save Document” custom PassportPDF action and pass it the “FileId” the output of the “Document Load” action.
Add the “Create file” SharePoint action to create the PDF document in the SharePoint document library.
- Folder Path: Specify the output path to write the PDF file to.
- File Name: Name”_signed.pdf is the output variable of the “Get file properties” action.
- File Content: “Data ” is the output variable of the “Save Document” action.
Add the “Close Document” custom PassportPDF action and pass it the “FileId” the output of the “Document Load” action.
All Done! Navigate back to the original library and select the documents that you want to Sign. Click on the “Button”. It should open the blade in which you can add your Certificate File specify the Certificate and ‘Run Flow‘. After a few seconds, you should have an email with a PDF attachment.
.Subscribe to this blog for the latest updates about SharePoint Online, Nintex, Microsoft Flow, Power Apps, and document conversion and manipulation.