I have the following dashboard data expression that looks at the results (view) of a Survey123 form and groups by Truck Number and does some basic addition. The Survey123 form displays fields based on a parameter URL. Each station, such as Fingers 1, Barrel, or Plow Drop, has a QR code that determines the fields that judges see. All of the results are populated into a single HFL. We can can calculate a Total Score field using ArcGIS Pro but we would like for this to be dynamic in a Dashboard.
var fs = FeaturesetByPortalItem(
Portal("https://cohgov.maps.arcgis.com"), // your Portal's url
"b8411078d5fc40c9b65012fe72e02a4d", // the service id
0, // the sub-layer id
['Truck_No', 'Fingers1', 'Fingers2', 'Fingers3', 'Barrel', 'Serpentine', 'AlleyDock', 'StreetOffset', 'Mailbox', 'TirePush', 'PlowDrop'], // the fields you want to load
false // do you want to load geometries
)
return GroupBy(fs, ['Truck_No'],
[
{name: 'Fingers1score', expression: 'Fingers1', statistic: 'SUM' },
{name: 'Fingers2score', expression: 'Fingers2', statistic: 'SUM' },
{name: 'Fingers3score', expression: 'Fingers3', statistic: 'SUM' },
{name: 'BarrelScore', expression: 'Barrel', statistic: 'SUM' },
{name: 'SerpentineScore', expression: 'Serpentine', statistic: 'SUM' },
{name: 'AlleyDockScore', expression: 'AlleyDock', statistic: 'SUM' },
{name: 'StreetOffsetScore', expression: 'StreetOffset', statistic: 'SUM' },
{name: 'MailboxScore', expression: 'Mailbox', statistic: 'SUM' },
{name: 'TirePushScore', expression: 'TirePush', statistic: 'SUM' },
{name: 'PlowDropscore', expression: 'PlowDrop', statistic: 'SUM' },
// Add a new aggregation to sum all the score fields
{
name: 'TotalScore',
expression: 'Fingers1 + Fingers2 + Fingers3 + Barrel + Serpentine + AlleyDock + StreetOffset + Mailbox + TirePush + PlowDrop',
statistic: 'SUM'
}
]
)The featureset looks decent.

I'm running into two issues:
- The summed null values should convert to 0.
- TotalScore isn't working at all.
Any suggestions from the Esri Community?
Thank you!