I’m working on a FlutterFlow project where I need to map product references and quantities from the Cart Collection to the Orders Collection’s cartItemRef field during the checkout process. The cartItemRef is a custom datatype that holds ProductRef (as DocumentReference) and Product_quantity (as an integer).
Cart Collection Schema:
• Product_quantity (Integer)
• ProductRef (Doc Reference to Product)
Orders Collection Schema:
• Order_id (String)
• Order_amount (Double)
• Customer_email (String)
• Order_date (DateTime)
• Order_items (List of Strings)
• cartItemRef (List of cartOrderRef)
cartOrderRef Schema:
• ProductRef (List of Doc Reference to Product)
• Product_quantity (List of Integers)
I’ve already created a backend query to retrieve the ProductRef and Product_quantity from the Cart Collection. I need to create a custom function that takes these two as inputs and returns a mapped list.