Computed Field value doesn't change

Test_D.json (1.9 KB)

Test_F.json (7.3 KB)
In example above I have an easy computation result = number1*999999, if the number1 is filled.
In most cases it performs as expected, i.e. if the number1 is filled then it shows the result and if I afterwards remove the number1 value then the value in result is also removed (the result field is empty). However if I choose the number1 = 9,999,999,999, then the value in computed field is too big and I get an error: Error: Only values with up to 15 digits are allowed.
This is also as expected. However, if I empty the number1-field, it doesn’t change the value of result and does not remove the error message.
There is a workaround- to put a smaller number in number1-field then the value will change and then to empty the number-field1, then the result field will also be emptied. But this solution is not sufficient for our purposes.
Is it a bug or is there a way to empty the result- field as consequence of having empty number1-field?

Hi @dorota-linked-elm

I agree with your expectation that the value of the computed Field should be cleared when number1 is empty. You have a single entry in the Computation Table:

Precondition: FieldFilled(number1)
Calculation: [number1]*999999

which should lead to the result field being empty when number1 is empty. This works as expected for numbers under 1,000,001,000 as 1000001000 * 999999 has 15 digits.

However, 1000001001 * 999999 has 16 digits.

As a result, we can simply set Max Value: 1000001000 and ensure that only valid values are entered, as I have done in the attached models.

Test_D.json (3.9 KB)
Test_F.json (3.6 KB)

Interestingly, it appears that the value in the result Field would not be saved (even though it is still displayed) as it does not appear in the data.

It is a simple example showing the most basic situation for the problem which I actually have. In our situation the user can multiply several numbers, each of them having (possibly) decimal places. Some of the numbers can have up to 4 decimal places. Even if I put a restriction on the result that it also can have maximal 4 decimal places, it is not possible to define a maxValue.
I hope, it is clear what my problem is, if not I can copy a more advanced example.

Hi @dorota-linked-elm

Yes, I understand and I didn’t expect your real models to be as simple. However, the basic message remains the same:

Put an error message on an editable field which the end-user can update.

We should avoid allowing the end-user to enter data which leads to an invalid state by guiding them with Validation Rules.

These Validation Rules can be modeled with the Kernel Language or use a CustomCondition which can express validations that are not easy in A12 (the number of digits in a number). By referencing the inputs in the ValidationRule

AllFieldsFilled(number1,number2,number3) And CustomCondition TooLong

You will create jump link in the Validation Bar when the Form is fully validated. This will help the end-user correct the inputs leading to the invalid state (shown here in the screenshot based on a invalid value in a Field TotalLength.

I’m happy to help you write a bug ticket or continue looking for a solution here. To achieve this it would be helpful to know what the use-case is for saving a computed value as long as it is under 15 digits but then skipping the computation when if the inputs lead to this error.