Aug 08, 2022 01:12 PM
Trying to set up automation in script editor to show sum total from a table. This needs to only be sent out when new item is added to the table and an email sent out every 7 days
Aug 08, 2022 01:53 PM
Hi @Ryan_Mizak,
At this time Automations cannot perform calculations. You can run a script to gather data and perform a calculation, this will need to store the result in your base if you wish to send it out in another automation or subsequent action.
If you already have a formula field in your base making this calculation you can send it in an email.
What issues are you running into?
Aug 09, 2022 09:17 AM
My apologies, I am trying to figure out the correct script to run a sum calculation, but have gotten stuck.
Aug 09, 2022 09:31 AM
var array = [1, 2, 3, 4, 5];
// Getting sum of numbers
var sum = array.reduce(function(a, b){
return a + b;
}, 0);
console.log(sum); // Prints: 15
Aug 09, 2022 12:32 PM
sorry im new to this, will this be able to find a sum of a total in a row on a table?
Aug 11, 2022 11:05 AM
No, this is a javescript example you can use to show the sum of a column (field) of numbers. You would need to expand on your script to then add that to a record.
To Sum a Row (record) I would not use a script, I would use a formula field and SUM({number 1},{number 2})
What is it that you are trying to accomplish?