0

I have a requirement where the user is filling out the InfoPath form (saves to list) and adds an attachment. I need that attachment to also be copied over to a document library. However form my understanding this is not doable OOTB.

So another solution I found is I can put a link in the InfoPath form to the document library where they can upload their document. Then when they click on the list item to view the InfoPath form, I want to put a library web part under the InfoPath form toshow the form they uploaded to the document library that corresponds to that InfoPath form.

Is this possible how I am describing? If there is another solution please share as well.

thank you for any assistance.

0

You can create a workflow to copy the document from attachment into library. Sometimes default action (copy document) in workflow corrupts the document. In this case you can copy using http call inside the workflow.

Use this rest endpoint to get attachment files from list item.

 siteURL/_api/web/lists/getbytitle('ListTitle')/items(id)/AttachmentFiles

To copy documents in workflow using http, refer this article.

  • Yes I understand what you are saying. But I don't understand how when I click the link in the InfoPath form to go to the document library, when I upload the document how will the lookup column know to get that specific ID for the InfoPath form(list item)? – GuikPoint Sep 5 '19 at 14:40
  • Ok i get what you are saying. First the item needs to be saved and then the document needs to be updated. Only then you will get the id. You're req is not possible ootb or by infopath. You can design custom form (using html n javascript) for this. – harshal gite Sep 5 '19 at 15:11
  • We cant use custom code. What about a workflow that will copy the infopath attachment to a document library. If we do this it wont be necessary to do what we have been talking about. They will accept the attachment in the form and a copy in a library they can search later during audits. – GuikPoint Sep 5 '19 at 15:48
  • Please help with setting up the workflow. All it needs to do is copy the attachment to a library, nothing else. From everything I've found its possible but no one can explain it. I have been searching non-stop for two days and cant find anything. Thank you. – GuikPoint Sep 5 '19 at 19:22
0

Other options:

  1. Instead of an infopath form, simply add fields as needed to a library. The user will upload a file, then add content as needed to the library fields.
  2. Or, Instruct the users to upload their file to a library first, and then simply have a drop-down in the infopath form where they can select the appropriate file

Otherwise, copying list item attachment to a library is going to be tricky with OOB SPD workflows. This is possible with Microsoft Flow instead of SPD. Or as harshal gite mentioned, it can be done via http, but that's not a trivial process, and personally I'd try to modify the business requirements as to avoid that sort of thing.

So personally, I'd step back, figure out what the business goals are, and determine how best sharepoint can meet those goals, rather than trying to somehow make sharepoint do something it wasn't designed to do.

  • Can you clarify your point 2? Also, what about document sets? I have not worked with those yet, but from my understanding, it should work. Thanks for the help. – GuikPoint Sep 5 '19 at 22:04
  • For point 2, if the document is already in the library, you can have a drop-down field that simply lists the files in the library to pick from. Re document sets, those are great. Highly recommended. They are used when you need a group of files to be "processed" together, such as having a group of 2 or 5 or 50 documents all go through an approval workflow. In this scenario, all of the documents in the set would be approved together, rather than having to approve each file on its own. – Mike2500 Sep 6 '19 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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