Hi Team,
I have set below structure for users to input several fields, and provide a total using Field Definition Rules with "set expression" to calculate total. The total can be successfully calculated in the beginning.
However, the problem is that if user updates any field with "backspace" instead of input "0," the "set expression" rule seems can not work and will return below message:
"COM.VERTUNA.CONFLUENCE.PLUGINS.CONFIFORMS.UTIL.EXPRESSION$EXPRESSIONEXCEPTION: TOO MANY OPERATORS OR FUNCTIONS AT: +"
It is weird because if user input "0," then the total can be calculated correctly. I have tested multiple times, and seems only "backspace" would cause the calculation fail.
Could you advise?
Ps. The structure:
- Field A: $user input amount
- Field B: $user input amount
- Fied C: read-only to display calculated result
- Rule 1 for Field A (calculate total when there is input):
condition = empty
action = set expression
value = Field C = [entry.Field A] + [entry.Field B]
- Rule 2 for Field A (put "0" when there is no input):
condition = empty
action = set value if empty
value = Field A = 0
Rules on Field B is similar to on Field A.
Hi @Alice Liu and welcome to this community
Fix your expression to handle the empty value
FieldC=ZEROIFEMPTY("[entry.FieldA]") + ZEROIFEMPTY("[entry.FieldB]")
Alex
Hi Alex,
Thanks for the greeting and prompt reply!
I may not express my question clearly, but I did not set empty value rule on Field C.
The empty value "0" rule is set on Field A and Field B.
And my problem is that if in the beginning user input:
Field A = 100
Field B = 100
Then Field C can correctly display total 200.
But if then user use "backspace" to eliminate Field A's or Field B's value, then Field C will show the COM.VERTUNA message stated in my above post.
i.e. if afterwards user input:
Field A = 100 >> empty (using "backspace" instead of input "0")
Field B = 100
Field C = COM.VERTUNA.CONFLUENCE.PLUGINS.CONFIFORMS.UTIL.EXPRESSION$EXPRESSIONEXCEPTION: TOO MANY OPERATORS OR FUNCTIONS AT: +
But if user input Field A = 100 >> 0, then Field C will show 200.
Hope this example explain better. Could you help to see what I can change to solve this problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, and that is exactly what I was trying to help you with...
Let me try with the demo this time, I hope it helps
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alex Medved _ConfiForms_ I am getting this error:
Expression: [*] could not be calculated, Too many operators or functions at: *
and in some of the entries a 2 appears:
Expression: [*2] could not be calculated, Too many operators or functions at: *
The expression is quite simple and in some of the entries it works. The form itself is quite long, but the calculated field is only a multiplication between two fields:
Then for evaluationIT we have:
Then for evaluationDPO we have:
And finally the calculated field is:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe what you are looking for is actually a formula field, not calculated - unless you want to calculate this only once, on record creation, and never recalculate
And to handle empty values, as explained in the comments here you will need to wrap the field values in the ZEROIFEMPTY functions
ZEROIFEMPTY("[entry.evaluationDPO]") * ZEROIFEMPTY("[entry.evaluationIT]")
Aex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Alex Medved _ConfiForms_ , I am having an issue converting this to multiplicative form.
I have the following built with the following formula
MasterTechAgencyFee=ZEROIFEMPTY("[entry.MasterTechAgencyRate.masterpickagencyagencyrate]")*ZEROIFEMPTY("[entry.MasterTechAgencySalaryRequirement]")
Where the Agency Rate field is a smart field reference to another form (i.e. why I have .masterpickagencyrate on the end)
this should be providing an answer of 2 (100,000*.0002) but is instead providing 200,000 as the the answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but please provide a mathematically valid number - 0.0002
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm attempting to multiply it by 20% (however.02 also did not work), (20%*100,000=20,000). I'm unsure of how .00002 is not a mathematically viable number?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
instead of .00002 put 0.00002
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.