Link to home
Create AccountLog in
Microsoft SharePoint

Microsoft SharePoint

--

Questions

--

Followers

Top Experts

Avatar of Robert Thomas
Robert Thomas🇺🇸

Use info Path to upload a new document into a SharePoint document library
I wanted to create an Info Path form that uploads an excel file into a SharePoint Document library.  I want to use Info Path instead of the standard upload form, because the library will also have 2 columns that the user will need to add when they upload the form ( the forms status & group).  These are essential for the sites use and workflow. I feel like this should be possible, but I can't seem to find any information or even a place to start looking.  Most sites refer to saving the actual info path form inside of a SharePoint document Library as a document, which is not what I'm trying to do.  Thanks.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


SOLUTION
Avatar of Walter CurtisWalter Curtis🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of Greg BurnsGreg Burns🇺🇸

Robert, If I understand correctly, you want to use the Desktop version of InfoPath to allow the user to select a file, set metadata, and upload the file to a target library.

You cannot use a custom InfoPath form as the upload dialog for a SharePoint document library (this capability is limited to SharePoint lists; libraries have to use an ASPX form).  But you said that's not what you wanted anyway.

I think you might be able to accomplish this using some C# code-behind that could be activated on a button click.  

Without code, the built-in submit options are geared toward submitting the form itself to a SharePoint document library (which isn't what you asked for).  

Is InfoPath a requirement?  There are some free solutions that might fit the bill (I haven't tried any of these):

SPFileZilla on CodePlex / GitHub:
https://spfilezilla.codeplex.com/

SharePoint Bulk Uploader (but it doesn't set metadata):
https://spuploader.codeplex.com/

SharePoint Multiple File Upload Script
https://spfileupload.codeplex.com/

Here's another script based solution for a single file with metadata:
http://stackoverflow.com/questions/34952227/upload-file-to-sharepoint-online-with-metadata-using-powershell

Hope that helps!

ASKER CERTIFIED SOLUTION
Avatar of Walter CurtisWalter Curtis🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of Greg BurnsGreg Burns🇺🇸

Here's another thought in the "keep it simple" vein.  Let's say the user just wants to upload a file, they don't want to mess with InfoPath or a popup after the fact demanding metadata.  You can get around this by using subfolders in the library and setting the "Default Column Values" for each.  What this means is that contributors can navigate your library as though they were going to a file share, and depending on where it is dropped, the appropriate metadata will automatically be set.  Then you can create another view for "consumers" where the folder structure is flattened out, and users can search, sort, and filter based on metadata alone.  

This works whether they go to the website and drag a file into a library, or if they have the library synced via OneDrive (when the file is synced up, the metadata is automatically set).  If your workflow is triggered on creation, then it will have the metadata it needs to proceed.  

So how does it work? It takes a little planning and forethought, but once you set it up it's very simple to use.  Scott Jamison covers this in pretty good detail here: https://www.youtube.com/watch?v=LLLq-SeYPaI (but he doesn't show you how to set it up).  

Let's say you have two columns:
1. Department
2. Project Code

Department can be:
1. Field Services
2. IT Help Desk
3. Infrastructure

Project Code can be:
1. 2017-01
2. 2017-02
3. 2017-03
4. 2017-04
5. 2017-05

First, create a Managed Metadata Term Set to contain these values.
1. Go to Site Settings --> Site Administration --> Term Store Management
2. If your farm admin has granted you access to the Managed Metadata Service, you should be able to click the dropdown on "Managed Metadata Service App" and select "New Group".  Give it a name corresponding to your team or organization (e.g. "Contoso").
3. Click the dropdown on your group and create a new term set (e.g. "Projects")
4. Now create a second term set named "Departments"
5. Click the dropdown on each term set and create terms based on the values I gave above.

Now let's create a library to leverage these term sets.
1. Return to your site collection.  Create a new document library (e.g. "Projects 2017")
2. In the library, create two Managed Metadata columns:
a. "Deparments" (linked to Contoso-->Departments)
b. "Project Code" (linked to Contoso-->Projects
3. In the library, create folders:
Field Services
     Project 2017-01
     Project 2017-02
IT Help Desk
     Project 2017-03
Infrastructure
     Project 2017-04
     Project 2017-05
4. Go to library settings and click "Column Default Value Settings"
5. Select the "Field Services" folder. Select the Department field, and set its default metadata value to "Field Services".
6. Select the "Project 2017-01" subfolder, select the Project Code field, and set its default metadata to "Project 2017-01"
7. Navigate down the hierarchy and set values accordingly.

Create a "Contributor" View (which shows all documents and subfolders)
Create a "Consumer" view (which shows all documents but subfolders are hidden).

Now, when a user goes to the document library they will see a set of folders and subfolders that allow them to organize their documents just like you would on a file share (I usually also modify the "QuickLaunch" settings to show a treeview in the left pane of the page).  

You can even take this a step further by going into search settings and adding your metadata columns as Managed Keywords and adding them as refiners to your search results page.  Kinda neat.

Avatar of Walter CurtisWalter Curtis🇺🇸

Good point:

Let's say the user just wants to upload a file, they don't want to mess with InfoPath or a popup after the fact demanding metadata.

But a standard system will offer the opportunity to enter the required data automatically with no need for any additional programming.

User generated image
This screenshot shows SharePoint online, but all other versions have the same functionality, out of box.

Good luck...

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Robert ThomasRobert Thomas🇺🇸

ASKER

I think I am over thinking things a little. Making those field required maybe the best solution.  If that doesn't work, making a content type and then using info path maybe the best backup plan.

Avatar of Walter CurtisWalter Curtis🇺🇸

Thanks
Microsoft SharePoint

Microsoft SharePoint

--

Questions

--

Followers

Top Experts

Microsoft Sharepoint is a software platform and family of software products used for collaboration and web publishing combined. These capabilities include developing web sites, portals, intranets, content management systems, search engines, wikis, blogs, and other tools for business intelligence and collaboration. SharePoint has a Microsoft Office-like interface, and it is closely integrated with the Office suite.