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.

How - make a script operate on a repeating field ?

Featured Replies

I have a repeating field.. with 5 repetitions.

I want to make a script which, using a script parameter, will operate on

each repetition of the repeating field.

the script will simple insert a date if the field is empty for that repetition..

How can I do this ?? thanks smile.gif

  • Author

Ah.. I knew it had to be pretty simple !! thanks smile.gif

You can also use the Get ( CalculationRepetitionNumber ) function to act on repeating fields in a calculation.

Case(

Get ( CalculationRepetitionNumber ) = 1; "Result 1";

Get ( CalculationRepetitionNumber ) = 2; "Result 2";

Get ( CalculationRepetitionNumber ) = 3; "Result 3";

Get ( CalculationRepetitionNumber ) = 4; "Result 4";

Get ( CalculationRepetitionNumber ) = 5; "Result 5"

)

To simplify the script, you can use IsEmpty(Get(ActiveFieldContents)) instead of IsEmpty(GetRepetition( pling::theRep; Get(ActiveRepetitionNumber) )), since the cursor is already in the field.

You can also simplify Michael's suggestion by using Choose( Get(CalculationRepetitionNumber) - 1; result1; result2; result3 ... )

To simplify the script, you can use IsEmpty(Get(ActiveFieldContents)) instead of IsEmpty(GetRepetition( pling::theRep; Get(ActiveRepetitionNumber) )), since the cursor is already in the field.

You're right - but repeaters are still heracy in my book - Thanks for the input!!

--sd

  • Author

Is a portal really a better way to go when you know that there will never be more than a few entries into that field ?

Seems like a portal might be overkill... but I'm still very new to Filemaker... please enlighten me !! smile.gif

Well, this is a question that can't be answered easily - but a good rule of thumb is if you ever are going to make any sort of statistics on the values, are relations better. But if the requirement is to search in the field from the actual layout is repeaters faster due to indexing.

To make a judgement in your particular case, must a description of what the purpose of the scripting really is be know to us. Giving advise on repeaters is kind of giving brandy to an alcoholic, and I wan't least of all keep up an appearance that the bigger picture doesn't exist. Context matters and I'd dare to say that repeaters only should be used for special purposes - not a strong argument, but several expiriences of getting into deep, when trying get something serious out of data stored in repeaters.

So pease let me now, what the purpose is with the scripting...

--sd

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.