Partial validation of Rules containing NumberOfFilledFields and NumberOfFilledGroups

Hello community,

I am trying to set up rules that should be used in combination with a partial validation of a document. I am having trouble to find the right way to formulate rules to make sure that a field inside a repeatable group is a required field. Due to project reasons, I cannot use the “required” flag and I also have to create my rule outside of the parent group of the targeted repeatable group.

I came up with a rule that compares NumberOfFilledFields and NumberOfFilledGroups to make sure that for each instance of my repeatable group, the field has to be filled as well. This rule works fine with full validation, but it does not with partial validation, although the field is displayed in the UI. I also set it as “global”, but this did not help either.

Shouldn’t this rule work in combination with a partial validation? And is there another way to achieve my goal to make a field in a repeatable group required under my restricting circumstances? I would like to avoid using a helper field.

I attached a minimum example of my problem.
minexample.json (4.3 KB)
minexample-form.json (4.4 KB)

Hi @eva-solid-surge,

The best that I can do for you is offer a different solution with the same result.

NotAllFieldsFilled(../G1/RG*/F Having GroupFilled(../G1/RG))

This might be slightly more efficient than counting the numbers of fields and groups.

Unfortunately, you are bumping into 2 different limitations:

  1. Repeatable Contexts
    There is an open ticket (A12-15148) requesting the ability to model rules which reference repeatable groups to lie in different contexts.
    In your minimum example, G1 (which has the repeatable context) and G2 (which has the rules) are siblings. The Kernel sees this as “two different trouser legs” and you have restrictions on what rules you can model relating to the “other trouser leg” i.e. about groups and fields in the sibling group.
    If G1 was a child of G2, you could model the following rule as normal:
GroupFilled(G1/RG) and FieldNotFilled(G1/RG/F)

This error condition works with partial validation.

  1. Partial Validation
    This checks a limited list of fields and groups. The operators NotAllFieldsFilled, NumberOfFilledFields and NumberOfFilledGroups work with all possible instances of these fields and groups and therefore need a full validation to be able to correctly evaluate the field list that you are giving it.

I’ve linked this thread to the jira ticket I mentioned about and commented the ticket.

Hey @malcolm-silver-ice,

thanks for looking at my issue! I understand the problem with those operators. For my use case, I’ll have to use helper fields then.