Confiform Sum two fields

Barry Smyth
Contributor
February 13, 2023

A really simply question. I have six fields all numeric on my form. I want to create a 7th field that is the sum of all of those six that dynamically updates as and when any of those 6 fields are changed.

How do i do that in Confiforms??

1 answer

0 votes
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

Hi

Add a Formula type field to your form definition and set the formula expression

([entry.field1] + [entry.field2])

If they are non compulsory then do something like this

(ZEROIFEMPTY("[entry.field1]") + ZEROIFEMPTY("[entry.field2]"))

More on formulas in ConfiForms could be found here 

Alex

Barry Smyth
Contributor
February 13, 2023

I have tried this already

Setting a Confiform field definition to formula, and in the expression section trying both of the methods you described. 

and nothing happens when the fields are updated on the form. The formula field just stays blank.

Barry Smyth
Contributor
February 13, 2023

Sorry, slight update, when I use the ZEROIFEMPTY in does provide a total but only when the record is saved NOT as the values in the fields are updated. What I want is to have the form show the total as people enter data in the fields so that it dynamically updates as each field is updated.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023
Barry Smyth
Contributor
February 13, 2023

Oh good God no way. I don't want to have to write macros to sum to fields together so that they update dynamically on the form, that's WAAAAAYYYYYYY too much trouble. Thanks all the same.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

What do you mean "write macros"!? I dont quite understand...

Here is a screencast - just configure the field definition rule to set calculate the value for the field you want, adding it to changes in the fields that you want to track

http://recordit.co/4eWrc1TyEo

Alex

Barry Smyth
Contributor
February 13, 2023

What you just said doesn't make sense to me. I already have set the field to formula, but it only updates when the record is saved. That's no use to me and I don't see any settings that allow me to change that. 

The screencast shows the result but is not a "how to walkthrough" of how to set the form up todo that. It talks about importing code (which I am not going to do) using the confiform source editor. 

If there's a simplier way, great, talk to me like a confiform newbie so I understand what you mean. 

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 14, 2023

The page has a storage format that you can import and see what it does (and cloud version of ConfiForms has this built-in)... It is the easiest and only way to share configurations

I have also created a simple screencast for you to illustrate how the configurations looks in the editor

Barry Smyth
Contributor
February 14, 2023

I appreciate you are trying to help, but asking me to import a page so I can how the example you've provided works is as good as asking me to fly a space rocket to the moon, on a friday, during rush hour, with my eyes closed or to guess the next winning lottery numbers. 

Barry Smyth
Contributor
February 16, 2023

Nope, tried importing the source code onto a blank page and get an error, so as much as I would like to follow the example you gave seems its impossible. 

  • The reference to entity "field2" must end with the ';' delimiter. (400)

Shame there isnt a straight forward guide that shows you step by step how to do it.

Anyway, I've given up. Seems there are some things Confiform is good for, but simply adding to fields togethere isn't one of them. I will have to live with the "calculate on save" for now.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2023

I have recorded you a screencast - is it also hard to follow? There is literally one “set value” rule to add to your form

How more detailed this should be? I am just trying to improve and “fix” what’s broken 

Alex

Barry Smyth
Contributor
February 17, 2023

I tried everything you suggested. And while it all worked on screen and calculated as number were entered and the record saved. When it was brought back up to edit all the totals were wrong. I have no idea why, as all seemed fine. I had to to change one field in the formula to correct the totals and saved again. Clearly there's more to this in terms of field types (for example I used the same as you, READONLY) that need to be explored, but the form is already in use and I can't keep changing it as then I have to go back and edit all submitted records to correct them.

Anyway, I am sticking with calculate on save, it's not perfect but at least its accurate. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events