Page 1 of 1

calculate sum of select fields?

Posted: Thu Oct 31, 2019 4:52 pm
by ARWEN
Hi guys,

I have created an evaluation form with 50 select fields. These each contain the values 1...10. Now I wanted to display the sum in a Calc field. But these select fields are not available in the Formula-Builder. Why not?

Re: calculate sum of select fields?

Posted: Thu Oct 31, 2019 10:28 pm
by admin
ARWEN,

It doesn't calculate Select Objects.

Steven

Re: calculate sum of select fields?

Posted: Fri Nov 01, 2019 5:20 am
by kev1n
If you apply a little 'hack', you can manually add fields to the Formula Field and modify the formula as you want.
Then it even calculates Select Objects (if they contain numbers)!

This "manual mode" is also convenient if you need to modify the formula later. Currently you need to delete and recreate the formula. Especially for larger formulas, the "manual mode" has proven useful!

All you need to do is add this JavaScript under Setup -> Header:

Code: Select all

function nuOnLoad() {

	var p = nuCurrentProperties();
	if ((p.form_id == 'nuobject')) {
		// Calculator not readonly
		$("#sob_calc_formula").prop("readonly", false).removeClass('nuReadonly');
	}
}
manually edit formula.png

Re: calculate sum of select fields?

Posted: Fri Nov 01, 2019 6:13 am
by admin
Guys,

Select Objects are now included.

The changes are now on Sourceforge.


Steven