Trouble with SUM code expression

Custom Code

Hi there, I am only a few weeks into using Flutterflow so please excuse me if this is a simple fix

I have been trying for the past week to calculate the SUM of a list field which is full of integers by using a code expression

I am creating a document and passing various $ amounts into the same document field (labelled as holding a list of integers) by using the "add first item" list update type each time the user completes a form and presses the confirm button via a backend call.

I am then trying to have a text widget display the SUM of all the values in this field

What have you tried so far?

I have tried setting the text widget to display this using the code expression variable

I added an integer type argument which is a list and selected the value for this variable as the field which has the list of integers above

The expression I used is SUM(data.var1). Where var1 is the field with the list of integers

Did you check FlutterFlow's Documentation for this topic?
Yes
1
2 replies