Here is the dilemma I am currently facing:

1) I have a Sharepoint list with multiple folders in them. Eg: Engineering, Production, etc

2) I am creating a form, that has buttons that switches views when clicked on, based on Engineering, Production etc.

3) When I click submit, I would like to submit to the appropriate sub-folder

I setup the rule with a data connection to submit form, but the URL is incorrect for some reason?

The error message I get is as follows:

The file or folder name "http://mydomain.com/test/TestPRversionC/Forms/AllItems.aspx?RootFolder=/test/TestPRversionC/Production/PR-72.xml" contains invalid characters. Please use a different name. Common invalid characters include the following: # % & * : < > ? / { | }

An entry has been added to the Windows event log of the server. Log ID:5567

What could the incorrect code be? My file name is a concat of PR with ID number, so that should be unique. I also allow overwrite if file exists..

  • In the Sharepoint list, you can create folders, and what I would like to do is upon submission of the form, the form will go to one of the folders instead of the root list. Apparently there is no workflow to move that..
    – Shiroi98
    Feb 21, 2013 at 17:06

4 Answers 4


Don't use folders in lists. Use a column instead and then use views that filter by that column. Folders in lists don't make much sense. Even in libraries they should be used only sparingly. Metadata is a very powerful way to categorize and classify data. Folders have severe limitations, as you have discovered.

  • Hi, thanks for the info, but the reason we use folders is because each folder has a separate permission setting. Can that be done with views?
    – Shiroi98
    Feb 27, 2013 at 17:22
  • Maybe using different lists would be a better approach. It's easy to create reports across different lists for people who need to see all items.
    – teylyn
    Feb 27, 2013 at 20:49

Why don't you try using the following:

string url = HttpUtility.UrlEncode("http://www.google.com/search?q=Example");

That will encode the string, shouldn't fail as long as the url exists.

I hope it helps.


Please check the list/library name given in the data connections(manage data connections) For me the document library url in the data connection was incorrect. It contained "//" instead of"/". The issue got resolved after correcting the same.


on Button click you can write the code like this.

public void submitButton_Clicked(object sender, ClickedEventArgs e)  
        ////Need to submit the form to a programatically determined subfolder location (based on the date)  
        //Folder format is 2010_01_January or you can append the User Name here (YYYY_MM_MMMMM)  
        FileSubmitConnection submitConnection = (FileSubmitConnection)DataConnections["SharePoint Library Submit"];  
        submitConnection.FolderUrl = string.Format("{0}/{1}_{2}_{3}",submitConnection.FolderUrl ,  
            DateTime.Today.Year, DateTime.Today.Month.ToString("00"),   
        ////TODO: Need to create folder with SP Object Model to hold attachments as well before saving them there.  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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