Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Repeating fields in FM 9

Featured Replies

I'm a long-time user of Filemaker 7, and I'm curious whether FM 9 has fixed a problem in the way Filemaker treats repeating fields in scripts and lookups.

In FM 7, calculation fields can work with all the repetitions of a field simultaneously. That is, if VectorX and VectorY are both number fields defined as having three repetitions, you can create the calculation field VectorZ=VectorX+VectorY.

But by contrast the repetitions in a repeating number field can't all be changed simultaneously in a script step with Set Field [VectorX; 2*VectorY]. You have to set the individual repetitions separately: Set Field [VectorX[2]; 2*VectorY[2]] etc.

And, what is worse, it's impossible to set the values of a repeating number field using a lookup.

This inconsistency in the way the database treats repeating fields makes calculations a LOT more elegant when using repeating fields. And it makes for a confused developer, as I have to remember while scripting not to try certain things that would work in a calculation.

So I'd be willing to upgrade if I could get an assurance that this problem has been addressed in FM 8 or FM 9.

I don't know of any changes, except since version 8(?) you can specify the target repetition in Set Field by a calculation.

it's impossible to set the values of a repeating number field using a lookup

I am not sure I agree with that.

  • Author

I don't know of any changes, except since version 8(?) you can specify the target repetition in Set Field by a calculation.

You can do this in FM 7, too. But if you don't specify a target repetition in a Set Field script step, only the first repetition is set.

I am not sure I agree with that.

If you know how to do it, I'd love to learn how. When I set up a lookup for one repeating field, asking FM to look up the value from a repeating field in a different table, it only sets the first repetition and none of the others. I assume that these problems are related, that the scheme used to set fields in script steps is also used in lookups, and that in both cases it is unable to work with all the values in a repeating field simultaneously.

But if you folks know better, I'm eager to learn.

No, you can't. In version 7, the repetition to set must be hard-coded into the script set. In later versions, the repetition can be dynamically determined at script runtime by a calculation, e.g. Set Field [ RepeatingField [gCounter] ; "some value" ].

That's not my experience (incl. v.7.0v3). The rules for lookup are a bit different for repeating fields, but if the match fields are NOT repeating fields, a repeating field looks up all repetitions of the source field.

  • Author

In version 7, the repetition to set must be hard-coded into the script set. In later versions, the repetition can be dynamically determined at script runtime by a calculation, e.g. Set Field [ RepeatingField [gCounter] ; "some value" ].

Great! That's just what I'd like to be able to do. Thanks!

That's not my experience (incl. v.7.0v3). The rules for lookup are a bit different for repeating fields, but if the match fields are NOT repeating fields, a repeating field looks up all repetitions of the source field.
I stand corrected. Didn't seem to work for me last night, but it worked just fine now.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.