Is it possible to store attachments in a new folder everytime a form is submitted? - InfoPath Dev
in

InfoPath Dev

Is it possible to store attachments in a new folder everytime a form is submitted?

Last post 06-27-2011 09:35 AM by Hilary Stoupa. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-20-2011 01:48 AM

    Is it possible to store attachments in a new folder everytime a form is submitted?

    I have an Infopath form which will be submitted to a Sharepoint library. The user can add a maximum of 5 attachments. I would like to see that everytime when a form will be submitted that there will be a new folder with the xml and the attachments.

    At this moment the XML are stored in 1 folder but I would like to see that every submit generates a new folder, for example with the same name.

    Now I have a Sharepoint folder with all the forms stored like:

    form1
    form2 etc

    But I prefer to have

    newfolder1/form1
    newfolder2/form2

     Is that possible?

    At this moment the filename is set with a concat of the name who fills in the form and the time (now). So every submit has an unique name.

  • 06-26-2011 04:07 PM In reply to

    Re: Is it possible to store attachments in a new folder everytime a form is submitted?

    Hi Antarcticas!

    Wikipedia says there are no permanent human residents of Antarctica. Good luck with that as winter clamps down on your light supply. Replying to you during the summer in Seattle where we have >16 hours a daylight now... I love mother Sun!

    Your request is not an uncommon one. And, we have developed a solution for it in the past (I think a year ago). After building that solution (which required a little codin'), we decided to add the functionality to our qRules plugin, which you can download for free here.

    I'm trying to remember the sequence of commands, but it's Sunday and Pink Floyd is playing Momentary Lapse of Reason, so I'm a bit distracted, but I think you need to do a SaveToSharePoint:

     

    SaveToSharePoint Saves a file, a set of files, an image or a set of images to a SharePoint Document Library. Arguments: o url: URL to SharePoint document library o dsname: data source (optional): only needs to be specified if the xpath to attach is not located in the Main data source. o xpath: XPath to file/image attachment Examples: o SaveToSharePoint /url=http://<servername>/MyDocLib /xpath=/my:myFields/my:File o SaveToSharePoint /url=http://<servername>/MyDocLib /xpath=/my:myFields/my:Images/my:Image Additional observations: o Source field must have qRulesLink and qRulesFilename attributes (see Appendix C). o If uploading more than one file/image, the source field must be repeating (not a repeating field in a repeating group (see Appendix C). o This command can work without SharePoint, by saving files to an ordinary IIS website. Click here for instructions. o qRules will perform no action if the user calls the rule with no image/file attached. When designing your InfoPath solution, you can design your form such that the rule only executes when the image/file attachment is not empty (blank). o The InfoPath form and the SharePoint Document Library must live on the same machine. o This command works with file attachments saved in the browser.

    note: you can also use DeleteFromSharePoint to delete those images...

    I know there is a way to create the folder too but I'm having a hard time finding that in the User Guide so I'm going to send email to Hilary and ask her to reply.

    Best of luck!

     

    Patrick Halstead
    Project Manager at Qdabra
  • 06-27-2011 09:35 AM In reply to

    Re: Is it possible to store attachments in a new folder everytime a form is submitted?

    You can use the CreateFolder method of the SharePoint Lists web service to create your new folders. Then use qRules ChangeSubmitUrl to point the SharePoint Library submit data connection to your newly created folder. Finally, submit and you're done!

    Hilary Stoupa

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.