Code expression to sum amount field in a listview document in firestore

Custom Code

Dear all,

I have a firebase collection named "expenses". This has a field named "amount". When the user creates a document, he can choose whether it's an expense or an invoice, the type of them (e.g. rent, utulities) and he can also add the amount.

Now, as you can see in the photo I attached I have three fields: Expense, Income and Balance. On each one of them I want to show the total amount of expense, income (invoice) and the balance (probably income - expenses).

How can I do this? I was thinking with a code expression but i dont know where to put my hands.

Thank you

What have you tried so far?

Just tried to check code expression

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