Cascading dropdown with a twist - InfoPath Dev
in

InfoPath Dev

Cascading dropdown with a twist

Last post 05-12-2011 08:13 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-09-2011 08:52 AM

    Cascading dropdown with a twist

    My DataSource looks like this...

    MyFields
       RepeatingFieldHolder (Group)
            RepeatingField (repeating)
       LookupListGroup (Group)
            RepeatingLookupGroup ( Group - repeating)
                LookupList (field)
                LookupListCode (field)
                LookupListDescription (field) 
      PrimaryGroup  (group)
         PrimaryField (field) 

    I have a multiple selection box which stores data in /my:myFields/my:RepeatingFieldHolder/my:RepeatingField and uses  /my:myFields/my:LookUpListGroup/my:RepeatingLookupGroup for the data items.  The Description is provided by LookupListDescription, and the value that is stored is the LookupListCode.

    This works great.

    I then need to find out which of the entries ticked is the "primary" and store the information in /my:myFields/my:PrimaryGroup/my:PrimaryField

    So what I want to do is create a dropdown of all the values selected in the multiple selection box.  I can create the dropdown and use /my:myFields/my:RepeatingFieldHolder/my:RepeatingField as the source of the data.  BUT when I do that the list is only showing the LookupListCode - because I haven't stored the description.

    My thought was I could use /my:myFields/my:LookUpListGroup/my:RepeatingLookupGroup again and add a filter to see if the LookupListCode existed in /my:myFields/my:RepeatingFieldHolder/my:RepeatingField.  I have tried several different options and don't seem to be able to get the filter right.  I know I have to make sure I look in all the repeating fields - but need some help with the xml.  I have tried the following filters....

    my:LookupListCode = ../../my:RepeatingFieldHolder/my:RepeatingField
    my:LookupListCode = /my:RepeatingFieldHolder/my:RepeatingField
    my:LookupListCode = //my:RepeatingFieldHolder/my:RepeatingField
    count(/my:RepeatingFieldHolder/my:RepeatingField[.=current()/my:LookupListCode])=1

    Could someone point me in the right direction please

    Thank you

    Catharine

  • 05-12-2011 08:13 AM In reply to

    Re: Cascading dropdown with a twist

    Hi, Catharine:

    I've attached a sample form that I think does what you want. I started with more complex approaches to filtering the second multiselect, but turned out not to need them -- just a simple "Field from repeating group is equal to field bound to multiselect" worked in my case -- I am using IP 2010 (I remember with IP 2003 and 2007 there were cases where default values behaved slightly differently in regards to current(), so I'm mentioning that just in case). So that would be the equivalent of the first option you tried, I think. At any rate, try this template on your machine, and see if it works for you....

    Hilary Stoupa

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