Need to 1) create a folder based on a field on the and 2) submit to that folder - InfoPath Dev
in

InfoPath Dev

Need to 1) create a folder based on a field on the and 2) submit to that folder

Last post 05-28-2013 04:46 AM by donstephen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-20-2013 11:52 AM

    Need to 1) create a folder based on a field on the and 2) submit to that folder

     SharePoint 2010, InfoPath 2010, browser based form

     

    I have a requirement that when the user creates a form that it will 1) create a folder in the sharepoint library based on a field say:  Client Name (yes I will strip out any special characters) and then be able to submit the form to that library.

    Would love to be able to do this without any hard core coding and not have to publish the form via central admin

    thanks

  • 05-23-2013 09:38 AM In reply to

    Re: Need to 1) create a folder based on a field on the and 2) submit to that folder

    You'll have to use a workflow. 

     This should help you http://mylittlesharepoint.blogspot.co.uk/2012/05/create-folders-using-spd-workflow.html

     Although MS SP best practice is not to create folders.

  • 05-28-2013 04:46 AM In reply to

    Re: Need to 1) create a folder based on a field on the and 2) submit to that folder

    Hello Ron,

                    I conferred with some of the people here and another of our developers, Hilary Stoupa, suggested using the Lists.asmx service, which seems to work great with form libraries. Here is what it involves:

    1.    Add the attached CreateFolder.xml file to your form as a resource file.
    2.    Create a Receive XML File data connection using the resource file added in step 1. I will call this data connection CreateFolderXml for the rest of these instructions.
    3.    Create a Submit data connection to the Lists.asmx service for the SharePoint site you want to use (e.g. http://sharepointsite/sub/site/_vti_bin/Lists.asmx).
    4.    Select the UpdateListItems web method
    5.    Set up the parameters
    a.    For listName, use the ListName field in the CreateFolderXml data connection, and keep the default options.
    b.    For updates, use the Batch group from the CreateFolderXml data connection, and from the Include: dropdown, select XML subtree, including selected element.
    6.    Finish creating the data connection, accepting the default options
    7.    In the Fields taskpane of the designer, select the CreateFolderXml data connection, and expand the groups and fields until you can see the BaseNameSet field.
    8.    Add a rule to the BaseNameSet field that sets the value of the Field field to the value of BaseNameSet.

    Those are all the set-up steps. Now, when you want to create a folder, you would:
    1.    Set the value of the ListName field in the CreateFolderXml data connection to the name of the library where you want to add a folder (these fall under Form Load of the Data tab).
    2.    Set the value of the BaseNameSet field to the name of the folder you want to create (relative to the form library).
    3.    Use a rule to perform a submit on the data connection created in step 6 above.

    This works for creating folders that are multiple levels deep, e.g. Sub/Folder/Tree, but from what I can tell, will only work if the parent folders of the folder you want to create have already been created (e.g. Tree in the example above will only be created if  Sub and Folder have already been created.

    For the actual submit of the InfoPath form, you can use the qRules ChangeSubmitUrl command to modify the location of your SharePoint submit data connection.

    We've also attached a sample form and an XML File which you can use for the qRules Injector.

    Please give that a try and let us know how it goes.

     

    -Don

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.