none
current() function in Infopath 2007

    Question

  • I have two drop down lists in my infopath form.  They are populated by different secondary data sources.  The format of the data sources look like this:

    DataSource 1: <Items>
                                  <Item ID="100" CategoryID="1" Value="String1"/>
                                  <Item ID="101" CategoryID="2" Value="String2"/>
                               </Items>

    DataSource 2: <Items>
                                  <Item ID="110" CategoryID="1" Value="String10"/>
                                  <Item ID="111" CategoryID="1" Value="String11"/>
                                  <Item ID="112" CategoryID="1" Value="String12"/>
                                  <Item ID="113" CategoryID="2" Value="String13"/>
                                  <Item ID="114" CategoryID="2" Value="String14"/>
                                  <Item ID="115" CategoryID="2" Value="String15"/>
                               </Items>

    So the first dropdown will contain both values, but the second dropdown will only contain 3 values, depending on which value is selected in the first dropdown.

    I implemented this in Infopath 2003 using the folowwing XPath and it worked fine. 

    /Items/Item[@CategoryID = /Items/Item/@CategoryID[../@ID = current()/@Item]]

    But in Infopath 2007 I get this error: "@Item" does not point to a valid location path of a field or group

    Does anyone have any ideas?

    Thanks,

    -Somsong

    Friday, January 05, 2007 4:51 PM

Answers

  • To get around this error instead of pointing current to the @Item field in my Secondary DataSource 1, I pointed it to the @Item field in the main datasource.  This worked differently than it did in Infopath 2003.

    -Somsong

    Tuesday, January 16, 2007 10:10 PM