How to sum up values in a column from a type?


I have a Type Order where 2 fields are there. 1. Product and 2. Quantity. My User table have list of Orders.

Now when I design MyCart page, I need to show subtotal and grandtotal for every user. I could make up subtotal in every cell (product Price * Quantity), now I need to show Grand Total outside repeating group.

I am not able to do this. Can anyone suggest me, how to do it?

Also, I tried creating a new field in order type named SubTotal which has value = price * quntity. But i am also not able to add all those subtotals into grandtotal to display on mycart page.

Please Help


Data types:

title (text)
line items (list of line items)
user (user)
subtotal (number)
shipping cost (number)
total (number)

Line item
product (product)
quantity (number)
user (user)

name (text)
price (number)

You do not need to have a list of orders in the user data type. This will slow down the app needlessly at first … and later on when a user has more than a 100 orders … the app will be painfully slow.

In a repeating group of type line order with text elements inside it, search for line items of an order where the user is the current user. Do the math in flows and save the results to the respective number fields for subtotal and /or total of an order.

Hope this helps :+1:t2:

This topic was automatically closed after 70 days. New replies are no longer allowed.