Sum related table rows and use in merge field within Exact Forms Plus document

  • 0
  • 1
  • Question
  • Updated 6 years ago
  • Answered
I need to place the value (sum) of rows in a related table into a merge field in an Exact Forms Plus document.

Table A has (3) related rows in Table B.

My thought was to create a read-only field ( [Table Rows] ) in Table A which holds the value so it can be referenced in a merge field ~Table Rows~ within the document template.

Any ideas?
Photo of David W. Brown

David W. Brown

  • 0 Points

Posted 6 years ago

  • 0
  • 1
Photo of QuickBasePros (Laura Thacker)

QuickBasePros (Laura Thacker), Champion

  • 6,396 Points 5k badge 2x thumb
Where is your Exact Form coming out from?  In either case (parent or child), create a summary field to count the number of child records and use the Count field; or if the child table, then add the Summary (Count) field as a Lookup and display it from the Child record output
Photo of Keith

Keith, Champion

  • 1,320 Points 1k badge 2x thumb
Hi David,
its definitely easier to create a summary field in the relationship to sum related data and store that sum on the parent record. Then you can reference that summary field in the template. ie. ~Total Price~
Another option: you can subtotal any numeric column in the subtable within the subtable configuration parameter list, use the "stlist" parameter and reference the field id(s) that you wish to subtotal.

The benefit of the first option is that you can place that summary field anywhere within the template, the second option EF+ will place the subtotal directly under its column for you.

Here's an example of both options in an output document