Default value of static field = field of a specific row in a repeating table - InfoPath Dev
in

InfoPath Dev

Default value of static field = field of a specific row in a repeating table

Last post 02-12-2013 01:26 PM by MichaelLogue. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-12-2013 09:01 AM

    Default value of static field = field of a specific row in a repeating table

     Here's the scenario:

     I'm working with a pre-existing form that I am not allowed to change the existing fields.  It's basically a travel request form (that's printed out for approval signatures) that includes Departure and Destination fields, with three VIA fields (via1, via2, via3).

     We need to track all "via" locations - even if there are more than  three intermediary locations.  I have created a repeating table where the user can input their entire itinerary.

     

    What I'd like to do is to have the three fixed VIA fields have a default value of the first three rows of the repeating table. 

     ie:  via1 = Field1 in row 1, via2 = Field1 in row 2, etc.

    I'd like to do this using rules as opposed to VBA.

     

    Any suggestions?

     

    Thanks!

    Mike

     

     

  • 02-12-2013 01:26 PM In reply to

    Re: Default value of static field = field of a specific row in a repeating table

     Disregard - I figured out a work-around.

     Basically, I used a combination of the double eval trick and nested substring-before/after functions to extract the info.

     

    In the repeating table, I created a hidden concat field that put the City and State in a single field.

    On the main form, I created a new field (strLocation) with the following double-eval statement using semi-colons to delimit the entries:

     

    strLocation

    eval(eval(group2, 'concat(my:strCityState, ";")'), "..")

     

    Then, for each of the VIA fields, I used the following:

     

    via1

    substring-before(strLocation, ";")

     

    via2

    substring-before((substring-after(strLocation, ";")), ";")

     

    via3

    substring-before((substring-after((substring-after(strLocation, ";")), ";")), ";")

     

    Probably not the prettiest solution, but it works!

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