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.

using variable in 'Set Field By Name' when field is a repeating field

Featured Replies

Good morning. I am building a sports league results listing with a large number of teams.

I am trying to use a variable in 'Set Field By Name' to write another variable into a field. My field is a repeating field i.e. MayGro[1]. I use a routine to calculate the first 6 letters of the field name which I call $homeaway and then append the repetition number. My line looks something like - Set Field By Name [$homeaway & "[1]" ; $r1] (where $r1 is a variable holding the home team's points for this game). It doesn't work.

I am a real novice at Filemaker and am hoping that someone will be able to see where I am going wrong.

Also why does the 'value' step in the Set Variable routine say that the 'Calculated value must be text' although the value I am using is definitely a number.

Many thanks

Graham Keeley

  • Author

Hi

I've done some reading and it would appear that it's not possible to use a variable in the 'Set Field By Name' script step. What a shame, will turn what was a short script into a very lengthy one.

Cheers

Graham Keeley

My line looks something like - Set Field By Name [$homeaway & "[1]" ; $r1]

That should work - so most likely, you're not calculating the field name correctly.

However, I would suggest - no, make that strongly suggest - you use records in a related table instead of repeating fields. When it comes to sorting and summarizing, repeating fields are impossible to work with.

Also why does the 'value' step in the Set Variable routine say that the 'Calculated value must be text' although the value I am using is definitely a number.

That's a good question.

I've done some reading and it would appear that it's not possible to use a variable in the 'Set Field By Name' script step.

Get better reading material...

  • Author

Hi again

Well I seem to have cracked it. i have added the table name and the line now looks like this

Set Field By Name ["Results_Table::" & $homeaway & "[2]" ; $r2]

and that does the trick.

Cheers to anyone that looked at the problem.

Thanks

Graham Keeley

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.