The CreatorCon Call for Content is officially open! Get started here.

Need to calculate the numeric sum values from multiple fields

Raul Luna1
Tera Expert

I have four fields that have dropdown values of 1, 2 ,3. I need to know how to add all the values that were selected in the fields and have the total populate in another field. Would I have to modify the 'Overall Reseach Score' dictionary item and write a script in the Calculated Value tab?

Fields:

  1. Strategic Alignment (dropdown selections 1-3)
  2. Community Support (dropdown selections 1-3)
  3. Institutional Risk (dropdown selections 1-3)
  4. Improve Capabilities (dropdown selections 1-3)
  5. Overall Research Score (Totals field)

So if each of the selected values were 1. Then the 'Overall Research Score' would be 4.

7 REPLIES 7

Hi Akash,

So i created onChange client scripts for each of the following fields like you recommended: Strategic alignment, Community support, Institutional risk, Improve capabilities. 

I also created an onLoad script with the same code. When i load the page i'm getting errors on each of the fields. Sorry i'm not coder so maybe I misinterpreted something in the code. 

Hi Raul,

I see a mistake in the var researchScore part of the code. You should be using the declared variables in the parseInt() function.

Please replace it with the following

var researchScore = parseInt(strategicAlignment) + parseInt(communitySupport) + parseInt(institutionalRisk) + parseInt(improveCapabilities);

Hope that solves the problem.

Hi Raul,

Did the above answer work for you?

Please mark my solution correct and helpful if it did the work for you.

Thanks,
Akash Gurram