I use this in the ‘Formula’ for the field initially. It doesn’t update anything (that is why I have a Virtual Column - it updates the App when something is changed in the Total)
SUM(
LIST(
IF([M_IETotal] <> “”, [M_IETotal], 0),
IF([PlannedLodgingCosts] <> “”, [PlannedLodgingCosts], 0),
IF([PlannedLodgingTax] <> “”, [PlannedLodgingTax], 0),
IF([AirFareCost] <> “”, [AirFareCost], 0),
IF([BaggageFees] <> “”, [BaggageFees], 0),
IF([AirportParking] <> “”, [AirportParking], 0),
IF([HometoAirportRoundtripPOVCost70] <> “”, [HometoAirportRoundtripPOVCost70], 0),
IF([DrivingtoDestinationCost70] <> “”, [DrivingtoDestinationCost70], 0),
IF([RentalCar] <> “”, [RentalCar], 0),
IF([FuelRentalCarOnly] <> “”, [FuelRentalCarOnly], 0),
IF([Conf_RegFees] <> “”, [Conf_RegFees], 0),
IF([OtherCostsTotalOnly] <> “”, [OtherCostsTotalOnly], 0)
)
)
I have a Bot setup with a script to update the Totals Column when any update it made to a column affecting the Total.
function UpdateAppTripCost(TravelRequests) {
// Get the table
var table = appsheet.tables[TravelRequests];
// Get all records from the specified table
var records = table.newQuery().run();
records.forEach(function(record) {
// Calculate the Trip Cost Estimate
var tripCostEstimate = SUM(
record.M_IETotal,
record.PlannedLodgingCosts,
record.PlannedLodgingTax,
record.AirFareCost,
record.BaggageFees,
record.AirportParking,
record.HometoAirportRoundtripPOVCost70,
record.DrivingtoDestinationCost70,
record.RentalCar,
record.FuelRentalCarOnly,
record.Conf_RegFees,
record.OtherCostsTotalOnly
);
// Update the Trip Cost Estimate column
record.TripCostEstimate = tripCostEstimate;
// Save the changes to the record
table.update(record);
});
}
I’ve tried Return Values as well.. That didn’t work with the Bot either.