Design Workflows Builder Toolbox Enterprise Automation

Check out our ready-made templates available when you add a step and select Templates > 3rd party templates. You can use the templates to create a set of pre-configured steps. Need a specific template? Click the Contact us button in the top right of the page and let us know.

Before you begin

Copy and populate a Google Docs template

  1. In your Next Matter portal, click Workflows which should copy and populate a document.

  2. Click + Add step and select Integrations > Custom integration as the step type.

  3. Click Settings to configure the step. In this step, you’ll be creating a copy of the template.

  4. Enter the following details:

    {
      "name":"FILE_NAME",
      "parents":"PARENT_FOLDER_ID"
    }
    
    • To make sure Google Sheets uses the next empty row every time a new data set is populated, click + Add variable. Create an id variable and enter the $.id value.

    • Authorization: Google Drive

    • Headers: Content-Type: application/json

    • In the Body enter the values. For example, the body might look like the following:

  5. Save your changes.

  6. Now click + Add step and create another integration step to populate the data.

  7. Click Settings to configure the step.

  8. Enter the following details:

    Note that in the URL above the data in is a data reference from the previous step. Click the icon in the editor and find the data reference you need.

    • Authorization: Google Docs

    • Headers: Content-Type: application/json

    • In the Body enter the values. For example, the body might look like the following.

    • Method: POST

    • URL: https://docs.googleapis.com/v1/documents/{64. Copy the template - Copy the template document linked here - id (plain)}:batchUpdate/

  9. Save your changes.

  10. Now export the editable file to PDF. To do that, create an integration step with the following settings:

    Note that in the URL above the data in is a data reference from the previous step. Click the icon in the editor and find the data reference you need.

    • Authorization: Google Docs

    • Headers: Content-Type: application/json

    • Method: GET

    • URL: https://docs.googleapis.com/drive/v2/files/{64. Copy the template - Copy the template document linked here - id (plain)}/pdf/export

Insert the signature to a Google Docs file

The process of copying and populating the document has been described above. If you want the new version of the document to be signed, you need to get the signature before you copy and populate the file and after the file has been copied and populated with data, insert the signature in the document.

To get the signature:

  1. Click + Add step. Select to add a form.

  2. Click + Add form field. Select Signature.

When you have the signature, go to the template file and place an image where you want the signature to be. This can be any image - you’ll be replacing it in the course of the workflow.

To replace the image, you’ll need its object ID. It will be the same for all signatures, so you only need to get it once.

To get the ObjectId, do the following:

  1. Click this Google Developer link.

  2. In the right-hand side Try this method section, in the Request parameters, enter your document ID in the documentId field.

  3. Click Execute.

  4. Copy the ObjectId from the response. It might look the following "objectId": "kix.pc8vwkqlqnur". You can find it within the inlineObjects attribute.

Copy the document file and populate it with data as described above.

When the new file is ready, replace the image with the signature.

To replace the image, do the following:

  1. In your workflow, create a new step. Select Integration> Custom integration as the type.

  2. Click Settings and enter the following details:

    Note that in the URL above the data in is a data reference from the previous step. Click the icon in the editor and find the data reference you need.

    {
      "requests": [
        {
          "replaceImage": {
            "imageObjectId": "OBJECT_ID",
            "uri": "{72. Provide the signature - Signature Input - Signature (plain)}",
            "imageReplaceMethod": "CENTER_CROP"
          }
        }
      ]
    }
    
    • Authorization: Google Docs

    • Headers: Content-Type: application/json

    • In the Body enter the values. For example, the body might look like the following:

    • Method: POST

    • URL: https://docs.googleapis.com/v1/documents/{64. Copy the template - Copy the template document linked here - id (plain)}:batchUpdate/

  3. Save your changes.

Add a footnote to the document

  1. In your workflow, create a new step. Select Integration> Custom integration as the type.

  2. Click Settings and enter the following details:Tip: use document.get from the Google Doc API to obtain the position of the index. See Google documentation.

    {
      "requests": [
        {
          "createFootnote": {
            "location": {
              "index": "INDEX"
            }
          }
        }
      ]
    }
    
    • Add a variable for the footnote_id with the value of $.replies[0].createFootnote.footnoteId.

  3. Save your changes.

  4. To add the text to the footnote, create another integration step and edit the settings with the following values:

    {
      "requests": [
        {
          "insertText": {
            "text": "TEXT",
            "endOfSegmentLocation": {
              "segmentId": "{2. Create Footnote - Fill out the template - footnote_id (plain)}"
            }
          }
        }
      ]
    }
    
  5. Save your changes.