How to create a document from a template in Microsoft Flow and sign it using AdobeSign

Nowadays many companies, regardless of their size, face a significant shift: more and more of their activities happen online. Whole businesses go online, teams raise their efficiency by changing their offline routines and communication into online ones. No wonder that document flow falls in line with the same trend. And using an electronic document flow system and e-signs is a common case.

You can make your operational life even easier and faster by integrating the workflow and electronic document flow system with the help of Microsoft Flow.

Moreover, we’ve prepared a ready-to-use solution on how to create a document (e.g. a contract) from a template and sign it using AdobeSign.

With the help of Plumsail Documents, we will create a purchase agreement from a template, convert to needed extension, save in SharePoint document library and send for signing using AdobeSign connector for Microsoft Flow.

This is how the result document will look after signing:

signed_contract

And also have a look at how the completed flow will appear:

adobe_sign_flow

Here is a step-by-step description.

Flow trigger

After you’ve opened My Flows, create a new one and select a trigger. Actually, you can pick any, for example, trigger a Flow when an opportunity in CRM is closed, or others. We will pick 'Manually trigger a Flow' just for demonstration purposes.

Get file content

Assign this action for a storage system connector. In this example, we store our documents in a SharePoint library. However, Microsoft Flow has many connectors for different systems. Here are just a few of them:

  • SharePoint
  • Box
  • OneDrive
  • Google OneDrive
  • Dropbox
  • SFTP
  • File system

'Get file content' action takes the content of the specified files from a document library. We need to specify the SharePoint site URL and path to our contract template.

get_content

Create DOCX from template

This is the action from Plumsail Documents connector for creating DOCX files from a template. You can find more information about this action by visiting this page.

If you use it for the first time, you’ll be asked for 'Connection Name' and 'Access Key'. You can type any name for the connection. For example, 'Plumsail Documents'.

Then create an API key in your Plumsail Account page, copy and paste it to the 'Access Key' field.

'Create DOCX from template' action has two parameters:

  1. Document content.
  2. Template data.

create_docx

'Document content' is just an output of our previous step.

Download the purchase agreement template we are using in our Flow. You will see that all the variables are put between {{ }} brackets. These fields will be automatically filled after we specify Template data.

You can create your own templates using this approach, it’ very simple, see detailed information about the template engine here.

To specify Template data, we use the JSON object as a source:

{
    "Number": "432",
    "Execution.date":"2020-05-25",
    "delivery.date":"2020-05-30",
    "buyer.name":"LUCKY LLC",
    "buyer.address":"3 Main St.New York NY 97203 USA",
    "company": {
       "email": "sales@sample.com",
        "address": "3 Main St.New York NY 97203 USA",
         "phone": "202-555-0131",
         "name": "Plumsail LLC"
     },
    "items": [
        {
           "product": {
               "name": "Monitor",
                "price": 99
           },
           "quantity": 10,
           "cost": 990
         },
         {
            "product": {
                "name": "Fridge",
                 "price": 4219.99
             },
           "quantity": 1,
           "cost": 4219.99
         }
      ],
     "total": 5209.99
}

With Plumsail Documents, you can generate documents in different formats from a template:

Convert DOCX to PDF

This is also the action available in Plumsail Documents connector for Microsoft Flow. With its help, we convert our DOCX file to PDF for further use in AdobeSign. To fill in the only field, select Result file from the 'Create DOCX from template' step in Dynamic content.

convert_to_pdf

By the way, Plumsail Documents can convert other formats. For example:

Create file

Use this action to store the completed agreement. Specify a SharePoint site URL, a library, the name of the document with .PDF extension, and for File content choose Result file – an output from the previous step of converting DOCX to PDF.

create_file

Create sharing link for a file or folder

We will need to share our contract with AdobeSign, that’s why a sharing link is needed. Pay attention to choose the right link type and scope – they should be 'View and edit' and 'Anyone with the link, including anonymous' respectively.

sharing_link

There is a tricky moment for SharePoint site collection – you may be not allowed to share files from libraries of your SP site. In the case of such a setting, the Flow will fail on this step. We need to change the settings.

For that, go to SharePoint Admin Center, navigate to Active sites, choose yours and click on the button 'Sharing' to edit the settings.

active_sites

For our purpose, the site content can be shared with anyone.

anyone

You may be worried about sensitive information while sharing files, but there is no reason for it; nobody can use the link, but the AdobeSign application for getting content to create an agreement for further usage in AdobeSign.

Moreover, there is another action in AdobeSign connector for Microsoft Flow to upload documents directly, but unfortunately, it doesn’t work now because of a lack of code integration. We believe that it will be fixed in the future.

Create an agreement from a document URL, and send for signature

This action creates an agreement, saves it in the AbobeSign account and sends it to your partner for signature.

You can put any name for 'Agreement name'.

For Document URL field select an output from the previous step, and add ?download=1 to make the link direct. Otherwise, it won’t work.

Don’t forget to specify a file extension with .PDF

adobesign_action

The flow is ready. Now you know how to simplify your workflow processes using Microsoft Flow. See here some other cases how Plumsail Documents can be helpful for you. And if you are new to it, feel free to sign up for an account and get a 30-Day free trial.