unique value in repeating table - InfoPath Dev
in

InfoPath Dev

unique value in repeating table

Last post 04-16-2007 11:16 PM by thinking_spot. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-09-2007 11:41 PM

    unique value in repeating table

    Hi everybody,

    I tried to find a solution for my problem, but didn't found one in the forum. So that's my problem:

    I have a repeating table with two fields A and B. A is a normal textfield and B is another repaeting table. I want to have check if every row has unique values (combination of A and B), but A can have more than one B in one row. So it's possible to add:

    1. Row: A1 - B1
    2. Row: A2 - B2, B3
    3. Row: A1 - B2

    I try to check if there are unique values with preceding and following, like

    "fieldA isEqual preceding::my:table/my:fieldA AND
    fieldB isEqual preceding::my:table/my:fieldB"

    It's working with preceding-sibling and following-sibling to check if the repeating table B has already define a value in one row (see 2. Row).
    Infopath shows me an error in 3. Row (because A1 was already used in 1. Row and B2 was already used in 2. Row), but I want to check if the combination of A and B was already defined (so no error in 3.Row).
    Is my validation check wrong?
    I hope I describe the problem understandable and someone can help me.
  • 04-12-2007 07:16 PM In reply to

    Re: unique value in repeating table

    Hi thinking_spot and welcome to the forums!

    This does seem like a rather complicated situation. I think it would be easier here to do a string compare. Try this:

    Take the tutorial from this post:http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx except you want it to string together all of the values of the B repeating table. Then concatenate this with A and compare to siblings. Your condition will look something like this:

    xdMath:Eval(xdMath:Eval(my:group3/my:group4, 'concat(my:field3, ";")'), "..") != xdMath:Eval(xdMath:Eval(../descendant-or-self::node()/my:group2[my:field1 = current()/my:field1]/my:group3/my:group4, 'concat(my:field3, ";")'), "..")

    .........

    Well, I got really close to finishing this, but I've spent too much time as it is trying to figure it out. Hopefully this will springboard you into the answer! Please reply back when you figure it out so I can see the whole thing!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-16-2007 11:16 PM In reply to

    Re: unique value in repeating table

    Hi Matt,

    first of all thanks for answering. I tried your solution but it was not really working for me. So I tried a other solution. I add a attribute to my second column (the column B, which is the repeating table) and give this attribute the combination of column A and column B. And every time when I enter a new value in column B I make a validation check for the attribute like this

    "../preceding::my:fieldB/@my:attributeB"

     It works good. But thanks a lot for your solution, because it gives me a hint that I can try it with the combination of both fields in a new field.

     

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