cancel
Showing results for 
Search instead for 
Did you mean: 

How To: use Nintex Mobile signature in Document Generation

Automation Master
Automation Master
4 4 1,589

The post is motivated by the case Rhia Wieclawek wrote about on her Twitter. Her case is possibly more complex, but the general question was: how can I use the signature from the Nintex Mobile inside a document being generated by  the nintex document generation action? Unfortunately this is not yet feasible only using Nintex products. This is because Nintex Workflow for Office 365 is not handling correctly the binary data (it loses null bits) so what I proposed was to use  microsoft flow.

The process

  1. User sings a form in Nintex Mobile.
  2. The signature along with the form is saved in a SharePoint list.
  3. Then the Nintex workflow on item's creation is triggered.
  4. It builds a JSON, that is a request body, then calls Microsoft Flow, passing:
    1. form's title and
    2. base64 encoded signature from a multi-line text field.
  5. Flow receives the call, starts and uploads signature to the images library, converting it from base64 to binary.
  6. In resposne Flow sends the URL to the created file.
  7. Nintex receives the response and attempts to generate a document, having an image defined, that is the signature, having a variable set as a path (that is returned by Flow).
  8. Finally it generates a PDF with the signature inside.

Realization

Microsoft Flow

Its purpose is simple - get base64 encoded string and convert it into binary, then upload to a specified document's library. It is being invoked by a "Web Request" message, that should contain a valid JSON string, containing title of a form (it is using it to set file's name) and base64 encoded string.

{
  "Title": "Form's title or other text variable",
  "Signature": "The base64 encoded signature image"
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

After that it immediately calls SharePoint (using "Create File" action) and uploads the file, using the expression "Base64ToBinary":

base64ToString(triggerBody()?['Signature'])‍‍‍

After that it send back in "Response" action the uploaded file path:

Nintex Workflow

Is being triggered once a new item is created - user sends the signed form. Workflow purpose is to build a JSON that is a request body, and that is in a correct format - the one that Microsoft Flow workflow is expecting.

Then it calls the Flow, using the "Web Request" action:

And stores the "Response Content" in a text variable.

Then it builds an absolute path to the uploaded signature image, by joining workflow context's current site URL with the text received after Web Request call - the site relative path of the uploaded file.

Next it generates the document.using the Document Generation action.

The results

The working proof of concept:

You can find attached exported Nintex Workflow and Flow files.

4 Comments
Automation Master
Automation Master

OMG. 

I owe you big, . I will broadcast this post far & wide. Thank you so so much. 

sandy_s
Nintex Newbie

WOW!! .. Simply outstanding! Thanks for Sharing

fraserbaldwin
Nintex Newbie

Unfortunately Flow seems to keep changing my 

base64ToString(triggerBody()?['Signature'])

to just

triggerBody()?['Signature']

when I save the flow.

Any ideas?

fraserbaldwin
Nintex Newbie

Some additional screenshots...

When I first open the saved flow - it shows only the trigger body:

Then when I update it I add the base64:

And when I save the flow and go back it's back to just the triggerBody:

 

About the Author
SharePoint and Office 365 expert with many years of experience, implementing business solutions following the low-code / no-code approach using Nintex, Microsoft Flow, PowerApps. A fan of automation of modern workplace processes and solutions.