Finding a SharePoint document URL from a previously uploaded document.

  • 8 April 2011
  • 4 replies
  • 0 views

Badge +2

In my Infopath based process, I use the Infopath upload and then use the BlackPoint SharePoint process to upload the file into a library.


In a subsequent form view I want to use a URL to the document for an Approver to open and review the document.  I was hopeful that the BlackPoint process would keep track of where it has saved the document.  Does it do this?


If it does can I take the appropriate field from K2 and pass it back as a URL into my Infopath form?


Thanks


Brett Payne


4 replies

Badge +4

You can maintain the URL of Document Library in a environment field and then you can always maintain the name of the file that you have uploaded. Combine them to make the complete link and update the infopath xml field using the data event. That should work.


But here is the best way of doing it using Smart Object

Badge +2

Thanks for the tutorial.  It explains a lot and will help in another area but it is not quire what I am looking for as it used Infopath data connections to upload the captured file to a Library.


I am using the Library Upload event to save the document to the Library which is working fine.  However I then want to pick up the URL field captured by BlackPoint and copy it into the Infopath form.  I can "see" the URL in the Data Fields dialogue box before I open the form for the next reviewer step in Infopath and I have used a data event to copy that field into an Infopath field.


But the Infopath field is either a blank or a null string.  I presume I have a difference in data type that I need to fix.  I have tried converting the URL to a string and have variously set the Infopath firld to a string type and a URL type with no success.  I do not know what the data type is for the URL field in K2.  Can anyone help on this point?


Alternatively the <URL> characters prior to the URL itself are causing problems for InfoPath.  Any thoughts?


Thanks


Brett

Badge +4

I just tested this and it works.


1. Create an environment field which holds link of Document Library (ex: http://dev.abd.com/sites/My Site/My Document Library/


2. Now use a data event


     a. In the Destination use the xml field which u have assigned for the link control


     b. Now for the Source first drag the environment field that you created in the step 1 and then go to the K2 Object Browser -> Functions -> Infopath -> Get Attachment Name. Give the InfoPath Attachment fields as input parameter. This builds your link for the document.


3. Deploy and test it.


It worked smooth for me.

Badge +2

It only seems to work to a point.  I followed all the instructions carefully and it builds the URL just as you say but it still fails to post a readable URL into the Infopath form.  I still get an empty (blank) field.


So I went back to the other mechanism you suggested from the blogs to create a SmartObject for the target Library and call that from within Infopath. Using a trigger to handle saving the file and updating the URL within the form via that specific SmartObject rather than via K2 BlackPoint SharePoint Library events.  It all works super reliably but leaves me with a new problem.  Se me new thraed.


 


Thanks


Brett

Reply