Generating multiple forms from single data entry form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Generating multiple forms from single data entry form

Last post 04-20-2018 08:42 AM by Hilary Stoupa. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 02-21-2018 06:51 AM

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Generating multiple forms from single data entry form

    I'm wondering if the following is possible... We have 10 infopath forms that contain some duplicate data (such as client demographics). Not every form needs to be filled out in every situation. Is it possible to build a "master" form which will have 10 checkboxes, and depending on which forms the user needs, he selects the checkboxes, the appropriate sections on the form will be available to be filled out, and upon submit, the sections (as well as duplicated data) get submitted to the appropriate libraries as completed forms?

  • 02-21-2018 07:44 AM In reply to

    Re: Generating multiple forms from single data entry form

    Well - yes, it is possible. However, it would require code (or you could use qRules, which is code) - are you on Office 365? Or an on-prem SharePoint server?
    Hilary Stoupa

  • 02-21-2018 07:52 AM In reply to

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Re: Generating multiple forms from single data entry form

    I'm currently on SharePoint Server 2010 (and configuring 2016 for summer deployment - hopefully).  I have recently purchased qRules for the submitting to multiple lists feature, but I wasn't sure if it would allow multiple different forms to be generated.  Do you have instructions on how to configure this to work?

     

  • 02-21-2018 08:05 AM In reply to

    Re: Generating multiple forms from single data entry form

    I'd think you could use SubmitToSharePoint command - it submits XML to a library. You'd probably need to add an XML stub with processing-instructions for the various form types you can submit to (if you save the templates as source files, template.xml would make a great stub), use the SetXml command to set the stub to the correct current data from your form then use SubmitToSharePoint to submit the data. I don't know if we have any specific step by step instructions for this particular scenario, but hopefully this will be enough to get you started. :)
    Hilary Stoupa

  • 02-21-2018 09:06 AM In reply to

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Re: Generating multiple forms from single data entry form

     Okay, so I take my various forms, grab the template.xml from each, and add them as secondary data sources in my "master" form?  And then I can set the values of all the fields within each, and use the qRule "SubmitToSharePoint" to submit each secondary data source to a different library?  And it will submit just the secondary data source I want submitted, and not the entire "master" form xml? 

  • 02-21-2018 11:58 AM In reply to

    Re: Generating multiple forms from single data entry form

    Yup. You got it. The template.xml should have the processing instructions in it as well, so hopefully the submitted XML are properly linked to the correct template, but if you have any trouble, let me know. SubmitToSharePoint has a param that can take a data source, so you just give it the data source of the secondary data connection that has the XML you want submitted.
    Hilary Stoupa

  • 04-09-2018 09:02 AM In reply to

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Re: Generating multiple forms from single data entry form

     Okay, I think I may need some guidance on this one.  Here's what I've done:

    1. Get External Data From Other Source > From XML Data File > Click "Resource Files", select my "template.xml" file extracted from the infopath form I had created, renamed "LTCDeterminationOfEligibilityTemplate.xml".  Choose "automatically retrieve when form opened".

    2. Add some data to fields in this secondary data source.

    3. When button is pressed, submit using qRule: SubmitToSharePoint /dssubmit=ShPSubmit /dsname=LTCDeterminationOfEligibilityTemplate

     

    The data submits to the library, but it isn't appearing as an infopath form, it's going in as an xml file.  When I examine the file, it's missing these three lines at the beginning that appear in forms I submit directly:

     <?xml version="1.0" encoding="utf-8"?>
    <?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:LongTermCareEligibilityApp:-myXSD-2018-01-19T19-01-15" solutionVersion="1.0.0.19" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://ww-sharepoint/FormServerTemplates/LongTermCareEligibilityApp.xsn"?>
    <?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.3"?>

     If I paste these lines into the xml file that the qRule submitted, they will then open as an infopath form.  Note that these lines exist in the original Template.xml that I imported.

    Here's a screenshot of how they're appearing:

     

    The 1st item is a qRule submitted xml file with the three lines subsequently pasted in, and it now opens in browser as an infopath form.

    The 2nd is an unmodified qRule submitted file, and opens in the browser as an xml file.

    The 3rd and 4th are forms submitted from the original infopath form that the template was extracted from.

    What am I doing wrong?

     

  • 04-18-2018 01:15 PM In reply to

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Re: Generating multiple forms from single data entry form

     bump

  • 04-18-2018 05:12 PM In reply to

    Re: Generating multiple forms from single data entry form

    I'm sorry I missed this - thanks for the bump! You can use another qRules command to insert the PI (processing instructions) that are in the mso-infoPathSolution line. That should be all you need. Look for the InsertPI command in the qRules user guide - it has an example for this. Just run that command prior to submit, and you should be on your way.
    Hilary Stoupa

  • 04-20-2018 08:22 AM In reply to

    • PeteC
    • Not Ranked
    • Joined on 10-09-2015
    • Posts 12

    Re: Generating multiple forms from single data entry form

     Hi again Hillary, and thanks for all your help so far.  I've managed to get the InsertPi command working to insert two of the three lines, and the form now opens properly in infopath.  But for some reason the InsertPi command won't insert the <?xml version="1.0" encoding="utf-8"?> line

    As I said, the form opens in infopath, but I'm wondering if there will be any issues down the road with this line missing...is there a trick to adding this line I'm missing?

  • 04-20-2018 08:42 AM In reply to

    Re: Generating multiple forms from single data entry form

    You won't be able to insert the XML declaration, I'm afraid - but I don't anticipate this causing you issues down the road, either. I usually only insert the mso-infoPathSolution processing instruction.
    Hilary Stoupa

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