Hi,
I’m looking for a predicate in the validation language that can check if repeats have been filled uniquely.
Example:
Validate that my shopping list doesn’t have the same item multiple times
E.g. not two items “BIG Tomatoes” on the shopping list
Validate that the same item isn’t on the shopping list and on the retour list
E.g. not two items “SMALL Tomatoes”
Shopping list
- Item[1]
** Type = “Tomatoe”
** Size = “BIG”
** Number = “6”
- Item[2]
** Type = “Tomatoe”
** Size = “BIG”
** Number = “2”
- Item[3]
** Type = “Tomatoe”
** Size = “SMALL”
** Number = “6”
Retour list
- Item[1]
** Type = “Tomatoe”
** Size = “SMALL”
** Number = “1”
Hi,
For the first example:
Have you tried to use the rule RepetitionNotUnique<fieldList> in validation language?
Looks good to check it in one repeatable group. Thanks! I’ll try this.
But does this also work if I want to check that the same item is not entered into two different groups (the “small tomatoe” in my example)?
I asked @jennifer-tinted-cluster from BPS yesterday and she will give you an answer for the second example. 
hey @tobias-amber-boulder, we’re on it. thanks for your patience.
In my opinion, the best solution would be to use one of the fields, in this case the type field, as the index field of the repeatable group. You can specify this on the repeatable group itself, after you defined the group and the fields of course. 
This will automatically validate that the field values are unique over all instances of the group. It also gives you the possibility to use further validation language constructs which are similar to an SQL join. Look for parallel iteration in the Validation Language Guide for more information.
If I understand correctly, there is not one index field in this use case, but the combination of Type and Size needs to be unique in each table and inbetween the tables as well.
For the second example, I found a way to model it like this:
- Concatenate Type and Size in the field TypeSizeConcat in each repeat
- Rule: AtLeastOneFieldValueIncludedInValueList(RetourList/TypeSizeConcat in ShoppingList*/TypeSizeConcat)
As far as I learned, a computed field (TypeSizeConcat) cannot be an index field, thus it is not possible to use the parallel iteration feature for this use case.