Need to calculate the numeric sum values from multiple fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2020 12:48 PM
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:
- Strategic Alignment (dropdown selections 1-3)
- Community Support (dropdown selections 1-3)
- Institutional Risk (dropdown selections 1-3)
- Improve Capabilities (dropdown selections 1-3)
- Overall Research Score (Totals field)
So if each of the selected values were 1. Then the 'Overall Research Score' would be 4.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 05:45 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2020 07:02 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 07:53 AM
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