SUM of Field in Related Items
Hello Team,
I'm still a little new in the JavaScript world, but I'm stumped on a problem with a couple of apps. The end goal is to SUM all of a field in all related apps.
App1 (Travel Form) - Collects several events into a single travel event
App2 (Event) - calendar events to generate multiple inquires
App3 (Inquires) - New potential relationships
In Event App, I have a Field, "Event Inquiry Count" and the calculation is Number(@All of Inquiry Name.length).toFixed(0) <-- This works fine and is counting the number of Inquiries items related to the Event
This is where my challenge is, I need to SUM All of Event Inquiry Count to the Travel Form App however, the only thing I can seem to pull is counting the number of Events. Help?
Thanks all!
-
Hi Jeff,
did you try:
@Sum of Event Inquiry Count
? If this is available in the field tokens after typing@Sum of
the field "Event Inquiry Count" isn't number type, but the numbers in there are (text) strings.Why do you use
Number(@All of Inquiry Name.length).toFixed(0)
to count the number of inquiries?
With@All of Inquiry Name.length
you would get a real number. And the displayed decimals you can control in the field settings. I you want to try this, create a new calculation field with@All of Inquiry Name.length
. Cause a once saved field keeps its format (text, number, date) and you can't change that. The values of this new field you can sum in the Tavel Form withSUM of this field
.By the way: As I see you know that
.toFixed()
changes a number to a string (format). And withNumber
I think you wanted to parse it back to a number (format). But you*ve set the brackets not correctly. It must be:Number((@all of Inquiry Name.length).toFixed(0))
. As I said:.toFixed(0)
isn't necessary and so `Number' isn't also not necessary. And setting the brackets right in the existing field won't work, cause it's already a string type calculation field.Rainer
rg@delos-consulting.com
Please sign in to leave a comment.
Comments
1 comment