Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission - InfoPath Dev
in

InfoPath Dev

Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

Last post 07-20-2017 03:46 AM by _asp_. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 08-29-2014 08:23 AM

    Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

    Ok, so first off, I'm a complete newbie to InfoPath and sharepoint development so my apologies in advance.  What I'm trying to do seemed like it would be really quite simple, but is turning out to be a time and effort cow...  

     The concept is simple - create a firewall rule request form, with a repeating table for one or more rules (see the example below).  The challenge I'm having is that I want to display the repeating table data on the sharepoint approval workflow template as well as be able to use that data for a M2M submission (via email) that will create a change ticket in our change management tool.  I'd say I'd just scrap the display on the approval template, but suspect I'll be running into the same issue when I got to do the email submission...  The question is, how do I display/loop through the repeating table data and display that in another form as secondary data and/or in an email submission (following a SP workflow approval) to another system?  I've managed to get the non-table data into the approval form, so that seems pretty straight forward, but I'm really struggling (despite probably 4 hours of googling) with this one.  One thing I've considered is submitting the table data itself to a "sub" list in sharepoint, but that just seems like a ridiculously complex way of doing it.  There must be some kind of foreach or while loop I can use to loop through the data in the xml file and display it no? 

     

    EDIT: Ok apparently I can't upload or copy images/screen clipings into here...

     

  • 09-05-2014 05:20 PM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

     I'm sort of confused by your description of the problem, can you explain it again in more detail?  Also, you can attach images to your post using the "Options" tab near the top of the reply page.

    Jennifer Lindsay
    Qdabra® Software/InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 09-08-2014 07:49 AM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

     Hi there, thanks for the reply.  I'll try and explain in a different way..

     

    I have an initial form that uses a repeating table (firewall form.png) for the details of a firewall rule.   initially only one row, but could potentially be any reasonable number (2, 4, 9, 13).  Then I have a SP2013 workflow for approval of the request, that I would like to have the information from that repeating table displayed in for the approver to see.  Following that approval, I want the workflow to parse and email the request to a different system, again containing all the information and rows from the original form.  Unfortunately I can't figure out how to have the repeating table data from the original form pulled in as a secondary data source into the approval workflow/form, and assume I'll have the same problem when it comes to parsing and email the system to system email.

     I did do some reading about posting the repeating table to another sharepoint list.  and something else about maybe using XPathNavigator to parse the xml itself... but surely there must be a better/easier way.  This seems like it would be a pretty common thing to do (analog being something like an expense form where there could be multiple lines added to a form, and then a separate workflow for a manager to view and approve those expense line items).

     

    Hopefully that helps to explain it.  Attached is the original submission form, then a sample of the xml posted to the SP list, and the approval form (not working, displaying merged information from the original form).


  • 09-08-2014 07:50 AM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

     


  • 09-08-2014 07:52 AM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

     approval form


  • 09-08-2014 08:08 AM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

     Hi there,

     How about sending a link to the form in your workflow emails? Then when your approvers click the link to open the form, you could show them a read-only view of the data so they could see but not modify it. Then you don't have to worry about passing data from one form to another.

     If you really want the original form to be separate from the approval form, you can use CAML to save repeating data to a list, and then you can include a secondary data connection to that list in the approval form. Then you just need to have a query on form load that searches the list for the appropriate rows and pulls only those rows into the form.

     Here's a tutorial on using CAML to save form data to a list: http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Add-SharePoint-List-Items-with-InfoPath.aspx

    Jennifer Lindsay
    Qdabra® Software/InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 07-18-2017 09:07 AM In reply to

    • _asp_
    • Not Ranked
    • Joined on 07-08-2017
    • Posts 19

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

    JenniferLindsay:
    Then you just need to have a query on form load that searches the list for the appropriate rows and pulls only those rows into the form.
    Hello Jennifer, can you explain this point in more detail please? I think this might be a solution for my request here: http://www.infopathdev.com/forums/t/38497.aspx

     

    Thanks!

  • 07-19-2017 11:00 AM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

    Hi, after reading your other post, I think what you want to try is the following: open your list form template in InfoPath Designer and add a receive data connection to your list. Then click the Form Load option on the Data ribbon, and add a rule to Form Load to query the data connection you just created, but make sure to set the Title query field to be equal to the Title field in your list form schema. This should make the form query the list for all items with the same title as the one in the form that you opened. If the query doesn't retrieve any results, then try moving the query rule to a button at the top of the form. Then there will be one extra step: you open up the form, and then you click the button at top to load all the other items with the same title. Did that make sense?
    Jennifer Lindsay
    Qdabra® Software/InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 07-20-2017 02:57 AM In reply to

    • _asp_
    • Not Ranked
    • Joined on 07-08-2017
    • Posts 19

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

    Thanks a lot Jennifer! Your answer makes sense, but I'm having trouble with this part: 

    JenniferLindsay:
    make sure to set the Title query field to be equal to the Title field in your list form schema.
     

    How can I set the Title query field? In the Form load action I can only choose to query for data and the source (see the attached picture)


  • 07-20-2017 03:06 AM In reply to

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

    Add another action immediately above the Query for data action to set the value of the Title field in the queryFields group in your secondary data source.
    Jennifer Lindsay
    Qdabra® Software/InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 07-20-2017 03:46 AM In reply to

    • _asp_
    • Not Ranked
    • Joined on 07-08-2017
    • Posts 19

    Re: Infopath w/ repeating table posting to sharepoint list, iterate through repeating table data to display in approval template and M2M submission

     Hurray! I made it with your help :)

    Still, I have a little problem: these rules work well in the display form, but when I click to edit, all the items of the list are shown (not only the ones with the same title). The same happens when I try to create a new item.

    Any ideas? 

     

    EDIT: I managed to not show all the items of the list when I create a new item, by adding the condition "Title is not blank" to the query action, but now when I try to edit and item I see empty form :(

    (the view display form works well)  

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