1

We have an InfoPath 2013 form created by a SharePoint designer workflow. We would like to add an attachment control to the InfoPath form. We understood that by design it is not possible to add such a control to an InfoPath form.

Is there perhaps a way to add custom javascript to the InfoPath form (e.g. sharepoint javascript object model) and let the form trigger the code when the user hits submit?

The aim is to have a user add a document to the InfoPath form. The document will then be posted to a document library.

What would be the approach here?

1 Answer 1

1

There is no approach to upload attachment in document library using Workflow.

But we can do alternate solution like mentioned below:

  1. Attach ItemAdded event on form library, where InfoPath form is created by workflow.
  2. Read xml file(InfoPath form) using OpenXML(C# code)
  3. Your file is stored in base64binary format in XML file, read it using XMLNode
  4. Upload file in document library (C# code)
2
  • Thanks Viraj. However, do I need visual studio for this? The form is generated by a SharePoint Designer workflow (i.e. it is a task form). Commented Dec 5, 2016 at 12:59
  • Yes you require visual studio. Make wsp file and deploy solution. On feature activation, event receiver will attach to form library. Commented Dec 5, 2016 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.