Help Needed: Generating Summary Table in PDF Invoice

Please I am using AppSheet to manage orders for my business and have a bot set up to generate PDF invoices. I need to include a summary table in the PDF that shows Roll_QTY values for each order and the count of how many times each Roll_QTY appears in the order.

Tables:

  1. Order Details:

    • Columns: OrderDetails_ID, Ref_Order_ID, Roll_QTY, Roll_Price_Per_unit, Ref_Fabric, Ref_Design, Ref_Color, Total_Price_Roll, OD_Cancel
  2. Order:

    • Columns: Order_ID, Order_Total_Price, Order_Status, Order_Delivery_Place, Order_Date, Ref_Client_ID, Is_Delivered, Is_Canceled, Is_Invoice_Created, Invoice_URL, Is_Paid, Payment_Method, Discount, Order_Total_After_Discount

Goal: For each order, I want to include in the PDF a summary table with the following structure:

  • First column: Unique Roll_QTY values.
  • Second column: Count of how many times each unique Roll_QTY value appears in the selected order.

Example: If an order has 3 products with Roll_QTY values of 20, 20, and 30, the table should show:

  • 20 in the first column and 2 in the second column (because 20 appears twice).
  • 30 in the first column and 1 in the second column (because 30 appears once).

Issue: I'm having trouble creating the template expressions needed to generate this summary table in the PDF. When I attempt to use a Start expression in my Google Docs template, it requires a list of key references, which I can't seem to produce correctly with my current setup.

Request: Could someone guide me on how to set up the necessary Google Docs template to achieve this summary table in the PDF? Any detailed steps or expressions would be greatly appreciated.

Thank you! ๐Ÿ™โค

Solved Solved
0 8 682
1 ACCEPTED SOLUTION

You should use Steve's Formula.

Something like this....

Template

TeeSee1_0-1717289856078.png

Result

TeeSee1_1-1717290065964.png

 

View solution in original post

8 REPLIES 8
Top Labels in this Space