I want to validate that my “selected offer”
{selected: “A-002”}
is referencing an “active offer”
{offers:[
{id: “A-001”, state: “active”}
{id: “A-002”, state: “active”}
{id: “A-003”, state: “inactive”}
]}
Is there a rule function for this?
PS: Please add samples to the “Validation Language PDF”
Hi,
you can achieve this by making use of the “semantic index” feature of the Kernel / Data Modeler. Please see my screenshot below.

The feature was introduced in Kernel version 4.0.0 which was part of the 2018.01 overall release (A12 Core Version 22.x).
For this to work, you have to specify one field of the repeatable group (offers) as the index field, i.e. the identifying field, in the group detail dialog. This field will also be validated to be uniquely filled among all instances of this group to make sure that this is indeed a valid identifier.
This index field is marked by the hash (#) after its name in the Data Modeler.
Very good!
Unfortunately I’m stuck with “A12 Data Modeler Version 21.3.8”
Is there a solution / hack for this in my version, too?
Yes, I think it should also be possible if you add a rule in the repeatable group as follows
AllFieldsFilled(/base/selectedOffer, id, state) and [/base/selectedOffer] == [id] and [state] != "active"
As you can see, you have to use absolute references here in order to reference elements which are higher in the hierarchy than your current group.
Unfortunately, this would break whenever you try to include this model into another one because these absolute references would no longer be valid.
Finally I was able to try this.
However, this doesn’t work for me. The repeatable group and the field “selectedOffer” are part of different models and are only inlcuded in a third model. So I cannot access the “selectedOffer” from within the repeatable group.
@erik-radiant-gorge, that would assume that I use an absolute path to use the selectedOffer as “ErrorField” within the rule, doesn’t it? Picus seems not to find the field in that case
Hej Jörg Amelunxen,
maybe this ticket <INTERNAL_LINK> is useful.
This got integrated in the data modeler 23.3.0 that has been released 2 days ago.
With this change it is allowed to use absolute paths if your field lies outside of the group and only for this case.
When entering ‘/’ all fields appear in the autocompletion. Even the ones from top level groups.
But be aware that the error field still cannot lie outside of the group, when iteration is used in the condition.
Unfortunately I do not have a solution for older product versions.
hope that helps 