0
votes

I am trying to display the contents of a specific folder on SharePoint within an InfoPath form. Here's what my current form is setup to do:

  1. The user selects a customer from a drop-down which is populated from List data on SharePoint. One of the columns in the list is the URL to a specific folder on Sharepoint that contains documents related to that customer.

  2. I would like a second drop-down to be populated with the names of the files in that specific folder based on the URL specified when a customer is chosen.

I can't seem to figure out a way to use a data connection to do this. Any ideas?

1

1 Answers

1
votes

You can do this in the code behind of the form. Grab the url of the folder from the drop down and pass it to the code. Something like:

using (SPSite site = new SPSite(SPContext.Current.Site.Url))
{
    SPWeb web = site.RootWeb;
    SPFolder folder = web.GetFolder(urloffolder);
    foreach (SPFile in folder.Files)
    {
       //populate drop down with each file
    }
}