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.
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":
After that it send back in "Response" action the uploaded file path:
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 working proof of concept:
You can find attached exported Nintex Workflow and Flow files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.