need help with a validatior
Hi @fcarmario I need your help again with a validator and I hope you could help me with that.
I have 4 different multiselect fields (product_A, product_B, product_C and product_D). Each field has 4 values (value_1, value_2, value_3, value_4).
The transition only should be available if value_2 is selected in one or more fields.
That means when another value is selected in one or more fields, the transition should not be available.
thank you! Best Regards, Karsten
Comments (9)
-
repo owner -
reporter Hi @fcarmario, I guess this was a misunderstanding.
ONLY Value_2 must be selected in one or more fields to make the transition AVAILABLE. If there is another value selected the transition should be UNAVAILABLE.
-
repo owner Hi kweigel,
You can implement the validation using "Boolean validator with math, date-time or text-string terms" with the following boolean expression:
"value_2" in %{aaaaa} OR "value_2" in %{bbbbb} OR "value_2" in %{ccccc} OR "value_2" in %{ddddd}
where aaaaa, bbbbb, ccccc and ddddd are field codes for product_A, product_B, product_C and product_D custom fields.
-
reporter Hi @fcarmario thank you for your help. I tried this expression already before but the problem with it is, that in this case the transition is also available when there is another value in one filed selected (e.g. product_A = value_2 and product_B = value_3). But under this seeting the transition should be unavailable. That means if there is in one of these fields another value than "value_2" selected the transition has to be unavailable.
-
repo owner Hi @kweigel,
Fields are Multi-Select, so more than one value can be selected in a single field. Should the condition be satisfied in the following sceneario?
- product_A: value_2, value_3
- product_B: value_2, value_1
- product_C:
- product_D: value_2
-
reporter Hi @fcarmario
Your sceneario should be unsatisfied the condition.
I defined two settings: 1. correct condition * product_A: value_2 * product_B: ---- * product_C: value_2 * product_D: ---- --> Transition should be available
2. incorrect condition * product_A: value_2 * product_B: value_1 * product_C: value_2, value_3 * product_D: ---- --> Transition should be unavailable
-
repo owner Try the following boolean expression:
("value_2" in %{aaaaa} OR "value_2" in %{bbbbb} OR "value_2" in %{ccccc} OR "value_2" in %{ddddd}) AND count(toStringList(%{aaaaa}) UNION toStringList(%{bbbbb}) UNION toStringList(%{ccccc}) UNION toStringList(%{ddddd})) = 1
where aaaaa, bbbbb, ccccc and ddddd are field codes for product_A, product_B, product_C and product_D custom fields.
-
reporter amazing! works perfect!
thanks a lot!
best regards, Karsten
-
repo owner - changed status to resolved
You are welcome
- Log in to comment
Hi @kweigel,
I find that your both sentences to describe the requirement are incompatible, i.e., they are contradictory:
Both sentences can be true at the same time: value_2 is selected in Field 1, and other values are selected in Field 2, Field 3 and Field 4. In this case transition should be available and unavailable at the same time?
Please, revise your description of the requirement.