Repeating Functions - File Maker

In general, repeating fields, and therefore, repeating functions should be avoided. Repeating fields are a holdover from pre-FileMaker 3 days, when FileMaker didn’t have relational capabilities. If you’re ever tempted to use repeating fields in the structure of a database, consider that a relationship with a portal is almost certainly the better way to go.

With that said, there are times when repeating fields still make sense. The most common use of them is for developer chores, such as holding graphics for the interface. For instance, if you don’t like FileMaker’s built-in interface for checkboxes, you can use your own graphics and store the on and off checkbox graphics in a global repeating field with two repetitions. But then you need a way to get the correct graphic out and into the layout tha the user sees. More on this shortly.

Extend(non-repeating field)

Value Returned: number, text, date, time, container.
When using a repeating field and a non-repeating field together in a calculation, such as when a repeating field has the line items of an invoice and a nonrepeating field has the tax rate, use the Extend function to have the nonrepeating field work with each value in the repeating field. The value returned is the same as if you had the non-repeating field as a repeating field with the same data in each repetition. The type of value returned is simply the type of the field.

Say you have a repeating number field with 5 repetitions called Item_Amount and a non-repeating number field called Tax_Rate. You want to create a third repeating field that holds the taxes for each of the repetitions in Item_Amount. Tax_Amount would be a repeating number calculation field with 5 repetitions and the following equation:

GetRepetition(repeating field, number)

Value Returned: text, number, date, time, container.
Use GetRepetition to extract a single repetition from a repeating field. This is the one you will most often use if you confine your use of repeating fields to developer functions.

Remember the previous mention of using a repeating field to hold the two graphics of a custom checkbox? If you have a global container field with two repetitions called gCheckbox_Graphics where the unchecked graphic is in the first repetition and the checked graphic is in the second repetition, and you had a number field called “Checked” that contained a 1 if the item was to show checked and a 0 if it was to show unchecked, you would use the following calculation to show the correct graphic:

Last(repeating field)

Returns the last valid, non-blank data in a repeating field. Assume that Rep_Field is a repeating number field with 10 repetitions, but only the first, third, and fifth repetitions have data in them, and that the fifth repetitions has the number 6:


File Maker Topics