Link to home
Start Free TrialLog in
Avatar of TRArter
TRArter

asked on

How to lookup the file name column of a SharePoint library from an infopath form

Hi Experts
We are using MOSS2007 Standard Edition and InfoPath 2007 (client)

I have an InfoPath form in a SharePoint form library where I want the user to be able to easily add hyperlinks to selected documents from another sharepoint library (on the same site). To build the URL link I need the file name with extension.

I have added a secondary data source which receives data from the library but only some of the columns are available. Even if I go into manage data sources the file name column does not appear in the list of available columns.

Does anyone know a way to get this data? I am new to MS development but I am able to write simple C# code in the form and use XPath, but not make and deploy more advanced  SharePoint features (although we have people who could if we had an outline solution) .

Thanks in advance
Trevor User generated image User generated image
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

Hey Trevor.

That title field is the actual file name without the file extension.

Typically you would create a hyperlink value via a formula. Concat("http://server/site/library/", title, ".ext")

Your title might have a filter of what the user selected or whatever. This does not require any code just some logic in your rules.
Avatar of TRArter
TRArter

ASKER

Thanks
But How do  I get the file extension, given that it can be different types of file (Word, Excel, PDF and possibly others)
Trevor
Yah that is a challenge. Typically I have only had one file type or different files have had their own library.

One option is a dropdown control of file types.

One thing I would test.  Try creating a custom view. You can add abunch of other data to the view and see which one mightinclude  extension or another clue to the file type.

InfoPath always queries the default view. Once you have created a new view andadded all of the columns to it. make it the default.  Modify your dataconnection and resave to update it.  Then drag all of the dataconnection on to a view and see what all of the data looks like.
ASKER CERTIFIED SOLUTION
Avatar of TRArter
TRArter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.