AnsweredAssumed Answered

Moving Infopath attachments to a SharePoint library

Question asked by tposzytek Champion on Jan 3, 2017
Latest reply on Jan 13, 2017 by tposzytek

In Nintex for SP2013/2016 in on-prem there is the action "Copy to SharePoint" which basically does the thing - it allows to copy attachments from particular XML nodes from Infopath form into a chosen SharePoint library.

In O365 there is no such thing.

 

I did some deeper analysis on the issue and realized, that:

  1. Infopath is storing attachments inside the XML file, converted to Base64 string;
  2. Infopath file cannot exceed 5MB in O365 otherwise it will not be saved…;
  3. The Base64 string does not only contain file contents, but according to the article: https://support.microsoft.com/en-us/kb/2517906 it does as well contain filename and some additional header information;
  4. There is no way to call javascript from Nintex Workflow (or is there any?). I thought, that maybe I can create a webpage with a javascript executed onload, however when reaching that page using “Web Request” action in Nintex (via the HTTP GET) it does not execute javascript code (what is understandable, as the HTTP GET request gets file contents from the server, not from the browser);
  5. Having failure there I then tried to create my own Content Type for Page Layout and was trying to inject there a C# script code block with the: ClientScript.RegisterClientScriptBlock function (so that my JavaScript could be executed while compiling the page), but in O365 code blocks are disallowed for pages as long as they are not provisioned by an add-in (sandbox model limitations). So again - failure..
  6. I can create a file using REST and SOAP web services, however I cannot cut off the header information from the Base64 string (as I don’t know where it ends), I cannot as well convert (decode) Base64 string to a binary (no such function, no available web service, etc…) without a custom code.
  7. It all leads me to a simple conclusion – in O365 I am not able to get Infopath attachments and store them in a given library folder. I have tried all options I could use. Nintex does not have it OOTB as it has in on-prem unfortunately - it should be done for example using the Remote Event Receiver (RER) that would be fired when a new Infopath form is submitted and that it does all the logic.

 

Has anyone got a similar problem? If so - how have you solved it?

 

Best regards,

Tomasz

Outcomes