Referencing Data in a Repeated Table - InfoPath Dev
in

InfoPath Dev

Referencing Data in a Repeated Table

Last post 06-30-2010 12:27 AM by Jimmy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-28-2010 01:18 PM

    • ben_v
    • Not Ranked
    • Joined on 06-24-2010
    • Posts 2

    Referencing Data in a Repeated Table

    I think this is a newbie question...

    I'm trying to use a repeating table to act as a replacement for a log that was kept as a paper list. I would like for the user to be able to check a box in one row of the repeating table and have the form email itself with data from two text boxes in that same row in the subject line. I'm having trouble referencing the text box in the same row as the check box that is selected. Currently, when you mark a check box that is on the second or lower row in the repeating table, an email is created but the subject line is populated with the data from the text boxes in the first row. I need the subject line to be populated with data from the same row as the check box that was just checked.

    Thanks for your time,

    Ben

  • 06-28-2010 11:28 PM In reply to

    Re: Referencing Data in a Repeated Table

    Hi Ben,

    You can create an XML file with the two data fields. For example:

    <?xml version="1.0" encoding="UTF-8"?>
    <Util>
        <Fields>
                  <FName></FName>
                  <LName></LName>
        </Fields>
    </Util>

    Add the XML file as a receive type data connection (select XML in the wizard). Then, do the following:

    1. Open the check box properties and add a new rule.

    2. Set the condition such that check box = TRUE.

    3. Add Action to Set a field's value.

    4. Select to set field1 from the XML source file so that it takes the value of field1 in your Main data source.

    5. Repeat step 3 to set field 2.

    6. Edit the email data connection subject value, replacing the fields using the one in your data source.

    Let me know if that works!

    Thanks,

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 06-29-2010 10:45 AM In reply to

    Re: Referencing Data in a Repeated Table

  • 06-29-2010 12:38 PM In reply to

    • ben_v
    • Not Ranked
    • Joined on 06-24-2010
    • Posts 2

    Re: Referencing Data in a Repeated Table

    Not to sound lazy, but is there a way to do this without creating an XML file? I'm a temporary worker and people coming in later to append functionality might not be versed in XML.

    Thank you

  • 06-30-2010 12:27 AM In reply to

    Re: Referencing Data in a Repeated Table

    You don't need a separate XML data connection for this, and I have no idea what Alec's blog post has to do with your situation.

    In the settings for your e-mail data connection, set up the formula for the subject line, so that it filters for the field in the same row where the checkbox is checked,  you can use the Filter Data... feature in the Insert Field or Group... dialog, or you can type out the XPath yourself, something like:

    /myFields/items/item[Selected = 'true']/Name

    But if you should happen to have two rows with checkboxes checked, only the first one will be used (not the most recent one).  To get around this, you will either need to use Jo-Anne's suggested approach, or implement a way to have only one row checked at a time.  Alec and I both have blogs on this:

    http://www.infopathdev.com/blogs/jimmy/archive/2009/08/05/a-mutually-exclusive-radio-button-in-a-repeating-section.aspx#comments

    http://alecpojidaev.wordpress.com/2009/08/26/a-mutually-exclusive-check-box-in-a-repeating-section/

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.