GetSummary() across relationships

Beginner

Use GetSummary() to retrieve summary field values for a specific sort group within a script or calculation, enabling programmatic access to report totals.

What you'll learn

  • How GetSummary() retrieves a summary value for the current sort group
  • How to use GetSummary() in a script to capture group totals
  • The sort requirement for GetSummary() to return meaningful values
  • Common use cases: exporting group totals, validation against a group total

Summary fields display their values in sub-summary layout parts, but they can also be accessed programmatically using GetSummary(summaryField; breakField). GetSummary() returns the value of a summary field for the break group containing the current record -- the same value you would see in a sub-summary part sorted by that break field.

1/3
1

GetSummary() syntax

GetSummary(summaryField; breakField) returns the value of summaryField for the sub-group defined by breakField. The found set must be sorted by breakField for meaningful results.

FileMaker Script
// In a calculation field or script -- get the subtotal for this client's invoices
// Assumes the found set is sorted by ClientId
GetSummary ( Invoices::TotalAmount ; Invoices::ClientId )

// Returns the sum of TotalAmount for all invoices where ClientId = current record's ClientId

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo