Skip 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.

Setting A Repeating Field

Featured Replies

I'm sure this is a "FileMaker 101" question so just call me an idiot!

I'm experimenting with repeating fields and for the life of me I can't figure out how to set the next available empty repetition. My little test script just replaces the first. How do you populate a repeating field?

Thanks,

Mel

for the life of me I can't figure out how

It's pretty easy, but not a required endevour ...since you by changing your approach to a more relational structure have this:

http://www.filemaker.com/help/Script-Steps20.html

However have Raybaudi, made the effords on your behalf:

http://www.briandunning.com/cf/472

...while I still think that you should avoid repeaters in your projects for a while learning relations instead!!!!!!!

--sd

I'm assuming that you are using the 'SetField' script step here...

There is more than one way to tackle this, I'm not big on repeating fields so someone else may have a much more elegant solution... Here goes..

Easy way..

When you use the SetField script step at the bottom of the dialogue box is a field that you use for the repetition. If you are populating a fixed repetition simply type in the repetition number.

The not so easy way..

If you need to calculate the next repetition number then you will need a field [number] in your table, you will increment this number via your script...

Field 1... Clients::NextRepetition

Field 2... Clients::RepeatingField

Script...

SetField[Clients::NextRepetition; Clients::NextRepetition+1]

SetField[Clients::RepeatingField[(Clients::NextRepetition)]; NewFieldContents]

When you stipulate the Repetition number as (Clients::NextRepetition) the script simply populates the next field repetition.

This method won't check that the field isempty first, so if you check out the LAST[] function in the help files you should be able to figure out a foolproofing method to prevent overwriting any existing data.

Like I said earlier, it's not elegant but it does work.

I agree with Søren (I think?): if you need this, you are most likely using repeating fields where you shouldn't.

Soren is dead right!

The first link he has provided is exactly the way you should go and it is the method I use.

Hence why I am not big on repeating fields... use of relationships should be your first priority.

  • Author

Thanks so much for all the help folks! I have read MUCH about avoiding repeating fields and have done so up until this point. BUT in this particular instance the repeating field comes in VERY handy. I am scanning documents that pertain to a certain record. The user can scan up to X documents and this number will vary depending on the "Job". I couldn't see creating 10,20 or 30 fields per record for 2 scans sometimes. These fields will not be relational, searchable or anything of the like. For me (in this case) the repeating field is ideal!

Thanks for all the input,

Mel

I couldn't see creating 10,20 or 30 fields per record for 2 scans sometimes. These fields will not be relational, searchable or anything of the like. For me (in this case) the repeating field is ideal!

Well technically they would be related.. you can just as easily (actually more... easily) dump them into a related structure (where the related table just has two fields, key and container) rather than dealing with them in repeating fields... That way you wouldn't have to set a limit either - But up to you i suppose.

I agree with Genx: this is a classic case for related records.

Just consider what would happen when a document is deleted.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.