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.

Set fields depending on stored fieldnames

Featured Replies

  • Newbies

I started using Filemaker 5 months ago and I have quite a complicated task to do. I was wondering if there is a way, in a script, to set a particular field whose name is stored in another field.

For example if I want to loop through some fields whose names are field1, field2, etc. So I thought I could store a count in a field (called "count", say) and then use it so that in each pass of the loop it sets the field named "field" + count.

If this is not possible I may have to bombard you all with the task in all its glorious entirety! confused.gif

Script | Set Field

Hi,

No, you can't set dynamically select the field to be targetted. It has to be clearly specified in the SetField[ ] script step.

You'd need to loop through all fields, in a "All Fields" layout and stop when Status(CurrentFieldName) = the content of your fieldName.

It may appear tedious, but you may reduce the processing time by dropping your fields in 5 different layouts according to their types (text fields, num fields, hour fields, date fields, Container Fields) and then use the correct layout depending on the FieldType.

HTH

It is possible to set a field, somewhat indirectly, based on its name; or its relative location on a known layout. But it's tricky.

You cannot directly specify a field to set by name. The only way (I know) is to Loop through the fields, using the Go To Next Field step (after starting at the beginning; definitely ending at the end), on a specified layout and tab order.

You can Exit Loop when you get to the field, by comparing Status (CurrentFieldName) to a name in a global field. Or, as you say, to an incrementing count. You can Set Field [ , the data ], NOT specifying the field; it will use the current field.

Exit Record pulls you out of all fields. Go To Field [Next] will then go to the 1st field.

FieldOnLayout.zip

  • Author
  • Newbies

Thanks Everybody!

I managed to do it by looping through all fields. It was a bit tricky and I pulled my hair out a lot but it works finally!

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.