Hi @alexis-raw-iron,
After chatting with @jan-static-daemon we see that there are two solutions to your issue. I’m presenting the modeling solution here. @jan-static-daemon will post the developer solution on How do I recompute an existing document in the backend?
As I already mentioned, the problem is that your computed field is pre-filled with the wrong value. With a computed Confirm Field, we only have the option to define the condition, when this field is set to true. This is normally sufficient as the Field starts off as empty (and the Form Engine works it’s magic when a user enters data).
In your case, strictly defining the negative case would be beneficial. With a Boolean, we can define the preconditions for the true and false values. This is stricter and will mean that both true and false are recomputed in the front and backends. If you leave the precondition for true as you have it and then model the following the Calculation of false for a Boolean field, you should enforce a recalculation.
Precondition:
FieldValueNotIncludedInValueList(../CountryOfEmployment, "AUT", "FR", "GER")
And ((FieldValueIncludedInValueList(../CountryOfEmployment, "VN")
And [../NationalCitizen] != False)
Or (FieldValueIncludedInValueList(../CountryOfEmployment, "CZ")
And ([../EUCitizen] != False
Or [../NationalCitizen] != True))
Or (FieldValueIncludedInValueList(../CountryOfEmployment, "PRT")
And [../EUCitizen] != False))
Calculation:
False
Please remember:
- This solution is more complicated as your requirement is more complicated than normal. This is only required if your Computed Trigger Field is pre-filled in the backend
- Take care with the preconditions for the true and false values. They must be mutually exclusive!
- There is an alternate solution to clear the field in the backend (see linked post)