Need Different Rule in 1st Row of Repeating Table - InfoPath Dev
in

InfoPath Dev

Need Different Rule in 1st Row of Repeating Table

Last post 03-23-2012 06:28 AM by MeganG. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-22-2012 05:46 PM

    Need Different Rule in 1st Row of Repeating Table

    Not sure of the best way to go about this, but I think I need a different rule to run on the first row of a repeating table than in the subsequent rows.

    I have a rule that runs when information is entered into the a Daily Sales field in a repeating table.  It changes the value of the Tomorrow's Goal field with a forumla that uses the value of Tomorrow's Goal in the preceding row. From Row 2 on that works great.

    But -- the first row doesn't have a preceding sibling and needs to refer to the Standard Goal outside of the table. How do I set things up so that the first row works?

    Standard Goal

    Row   Daily Sales Tomorrow's Goal
    1 Triggers Rule Standard Goal - Daily Sales
    2 Triggers Rule Standard Goal + (Preceding row's Tomorrow's Goal - Daily Sales)

    This is a browser-enabled form. Thanks.

  • 03-23-2012 05:47 AM In reply to

    Re: Need Different Rule in 1st Row of Repeating Table

    I can't speak for the details of your action (i.e. where the goal will come from), but I think what you're asking about is the condition. You'll need different rules with conditions such that:

    • One rule executes on the first row
    • One rule executes on subsequent rows

    I'm attaching a very simple form with an example. The rules and conditions are on the field1 node. Youll see that one condition is:

    count(../preceding-sibling::my:group2) + 1 = 1

    (for the first row)

    And the other condition (for subsequent rows) is 

    count(../preceding-sibling::my:group2) + 1 > 1

    Hope this helps!

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


  • 03-23-2012 06:28 AM In reply to

    Re: Need Different Rule in 1st Row of Repeating Table

    Thank you ErnestoM.  That is exactly what I needed.  Works perfect.

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