Combining field data with a Data Connection to save in a specific location - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Combining field data with a Data Connection to save in a specific location

Last post 09-20-2018 04:24 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-10-2018 07:45 AM

    Combining field data with a Data Connection to save in a specific location

    Hi.  I have a form which I want to use as a template in a Site Content Type so it can be used in multiple libraries.  The objective is to allow different Departments to have their own instance of the Library in a Subsite relevant to just their department.  The design of the libraries should be exactly the same as one another so that data is common (and can be examined for trends), users changing departments don’t have to learn a new system, management of the different libraries is simpler etc.  

    If I create a single ‘Submit’ data connection in my ‘common’ form, this dictates a specific Library into which the form is to be saved.  Even if I Publish the form as a Site Content type there appears (to me) to be no easy way for the form to understand the context of where it is used - for example in the ‘Operations’ department, as opposed to ‘Finance’, Sales, HR subsites and Library’s.  

    I was wondering if it is possible to have a data connection which doesn’t define the Library into which it should be saved specifically, rather that it defines the generic Site (in the line which should be for the Document Library on the data connection form), and then the Library and the file name is created in the File Name line (of the data connection form) as a ‘concat’ function from two or more fields?

    I’ve tried building the data connection this way however can’t get the combination of ‘/’ or ‘\’ or ‘%2E’ or similar to build the string correctly.

    Can anyone shed light on attempting this approach or suggest an alternative method I might want to consider?

    Thanks in advance – Alan C.

  • 09-14-2018 04:23 PM In reply to

    Re: Combining field data with a Data Connection to save in a specific location

    Sadly, this is something InfoPath just doesn't do well. The best non-code option I know of is to add a bunch of submit connections, and then use submit rules to determine which connection to use - your condition can leverage some of the URL functions to check the site the form was opened from. It's a real pain. If this is not Office 365, you can use code or qRules to do this. You can find some sample code here: https://blogs.msdn.microsoft.com/infopath/2006/11/08/submitting-to-this-document-library/
    Hilary Stoupa

  • 09-20-2018 07:15 AM In reply to

    Re: Combining field data with a Data Connection to save in a specific location

    Hi Hilary,

    Thanks for coming back to me over this one - I did think it unlikely that there was a 'simple' solution, or in fact much of a solution at all as I've hunted hard to see if there was an answer or guidance and I've found nothing.  I did read one person who has used a method of splitting the manifest.xsn out and running a script against that to alter the data connections, however that seems a 'shot gun' approach to the problem to my mind.

    Using multiple data connections is the only way I thought it can be done in one version, but in this instance that means creating 18 different 'Save To' connections. I don't think there is a maximum number which can create in a template file, but I'd hate to get to a maximum and then find the form falling over.  If there was a way of using a general Submit rather than a specific 'save to' I'd use it but that method is limited in terms of naming options.  I did wonder if I could use a workflow after the event though which is set to 'upon creation' to alter the filename to that which I need.  Perhaps that is worth experimenting with a bit.

    Thanks for your thoughts though.   Alan C. 

  • 09-20-2018 04:24 PM In reply to

    Re: Combining field data with a Data Connection to save in a specific location

    You could maybe have a single doc library these submit to and promote a field indicating where you'd like them to go - then use workflow to move them to the correct library.
    Hilary Stoupa

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