validation check of 2 concatenated fields in a repeating group/table - InfoPath Dev
in

InfoPath Dev

validation check of 2 concatenated fields in a repeating group/table

Last post 06-08-2007 12:21 PM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-06-2007 07:02 AM

    validation check of 2 concatenated fields in a repeating group/table

    Hi all

    I have following xml structure. <field1> and <field2> are text fields. User enters many types and categories. The validation has to check if a type combinated with category already exist.
    In this sample A1 and B2 is double in the structure. How can I set the validation in <category>?

    This is my validation:

    concat(../my:type, .) = ../../preceding-sibling::my:repeatingGroup1[concat(my:group2/my:type, my::group2/my:category)]

    It doesn't work.

    Has anybody a solution for me?


    type    category
    -----------------------
    A         1
    B         2
    A         1  --> validation- already exists
    C         3
    B         2  --> validation- already exists

    <group1>
        <repeatingGroup1>
            <group2>
                <type>A</type>
                <category>1</category>
            </group2>
        <repeatingGroup1>
        <repeatingGroup1>
            <group2>
                <type>B</type>
                <category>2</category>
            </group2>
        <repeatingGroup1>
        <repeatingGroup1>
            <group2>
                <type>A</type>
                <category>1</category>
            </group2>
        <repeatingGroup1>
        <repeatingGroup1>
            <group2>
                <type>C</type>
                <category>3</category>
            </group2>
        <repeatingGroup1>
        <repeatingGroup1>
            <group2>
                <type>B</type>
                <category>2</category>
            </group2>
        <repeatingGroup1>
    <group1>
     

  • 06-06-2007 09:38 AM In reply to

    Re: validation check of 2 concatenated fields in a repeating group/table

    You might find that trying to do all this with expressions and XPath is more complicated than its worth. Move to code for something like this and it will be more straight forward and probably more performant.
  • 06-08-2007 02:52 AM In reply to

    Re: validation check of 2 concatenated fields in a repeating group/table

    Hi Greg,

    thanks for your reply. I have to avoid code so I implemented following solution.

    My solution is to add an additional field <unique> to concatenate the values of the <type> and <category>. The validation check of category is based on this field <unique>.
     

  • 06-08-2007 12:21 PM In reply to

    Re: validation check of 2 concatenated fields in a repeating group/table

    That is a good solution which I hesitated to suggest because many do not have control of the schema to do that. But if you do, that's the easiest way. Then you only have a single field to check against--concat already complete.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.