Identifying specific repeated fields - InfoPath Dev
in

InfoPath Dev

Identifying specific repeated fields

Last post 09-08-2013 08:54 PM by Jimmy. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-28-2013 01:56 PM

    Identifying specific repeated fields

    I am counting the number of unanswered questions on a form in InfoPath 2010.  I have a text box (Integer) with a value of (myField01 = "") * 1).  I can repeat the equation for each field, sum them, and get the number of unanswered question. For example, (myField01 = "") * 1)  + (myField02 = "") * 1) + (myField03 = "") * 1).  Simple.

     However, this does not work with repeated fields.  If myField01 is in a repeating table, the equation does not know to look at all the repeats.

     How do I identify the repeated fields in my equation?

    Thank you.

    Filed under:
  • 08-29-2013 09:45 AM In reply to

    Re: Identifying specific repeated fields

    Instead of the approach you are using, you can do this:

         count((myField01 | myField02 | myField03)[. = ''])

    This should also work for repeating fields.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-30-2013 07:27 AM In reply to

    Re: Identifying specific repeated fields

    This works.  Thank you. However, I don't know how to count a special case.

    myField01 is a radio button that must be checked.  In this case, count(myField01[.='']) works.

    However, if myField01 is "Yes", then myField02 cannot be blank.

    In structured code I would write:  IF ((myField01=='')  OR (myField01=='Yes' AND myField02='')) then cntr = cntr + 1

    Can you please tell my how to do this using count?

    Thank you for your help.

  • 09-01-2013 01:55 PM In reply to

    Re: Identifying specific repeated fields

    Did you try: count(myField01[.=''] | myField02[.='Yes']) ?

    Patrick Halstead
    Project Manager at Qdabra
  • 09-03-2013 07:07 AM In reply to

    Re: Identifying specific repeated fields

     I don't think that's the correct logic.  What I need is this:

    if myField01 is blank, then count equal 1

     --OR--

    if myField01 is "Yes" and myField02 is blank, then count equals 1

    How do I code for OR rather than UNION? 

     

  • 09-08-2013 08:54 PM In reply to

    Re: Identifying specific repeated fields

     Please try this:

     count(myField01[. = ''] | myField02[../myField01 = 'Yes' and . = ''])

    or even this:

    count((myField01 | myField02[../myField01 = 'Yes'])[. = ''])

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