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.

Substitute Keywords from Related Table - exceed 1000?

Featured Replies

I'm looking for some help with a script for final keywords that needs to substitute keywords from a related table. This was working fine until I exceeded 1000 records in the related table that the replacement keywords come from. Apparently Filemaker has a 1000 row or record limit for this kind of script. Does anyone know a work-around for this? Here's the script I'm using: 

1485947452_ScreenShot2019-08-04at11_14_50AM.thumb.png.fdeef130973aea33164cea57a485dbdb.png

The Substitute() function has a limit of up to 999 search/replace pairs. If you're getting your pairs as a list from a related table, it should be easy to split the list to chunks of up to 999 values, using a loop and a calculation of:

MiddleValues ( $listOfValues ; 999 * ( $i - 1 ) + 1 ; 999 )

 

Or perhaps it might be simpler to have the script loop over the entire list and perform a single-pair substitution at each iteration?

 

Edited by comment

  • Author

Thanks for your response. I have limited FM scripting skills, so I need a bit more help on how to implement that. Someone else wrote the original script, so I'm not even sure exactly how it's working. Would I use a loop within my loop? Do I use the MiddleValues function within my Substitute function? Sorry for the dumb questions. I would gladly pay someone to just fix this for me. 

17 minutes ago, Schneids said:

I'm not even sure exactly how it's working.

I am not sure either, since I can't see the actual data it's working with.

  • Author

The data comes from an extremely simple table, with just a few fields. See attached. 

Screen Shot 2019-08-04 at 12.27.03 PM.png

  • Author

Does anyone else know how to solve this issue?

21 hours ago, Schneids said:

See attached. 

I am afraid that does not allow me to see your script in full context. It seems to be doing more than just substitution.

Have a look at the attached demo. It shows the simplest method to perform multiple substitutions, with no limit on their number (other than available memory). Note that this works on a single record; if necessary, you can add an outer loop to do this for all records in the current found set.

Also keep in mind that (a) the Substitute() function is case-sensitive and (b) subsequent substitutions are nested, so the order can matter.

 

MultiSubstitute.fmp12

Edited by comment

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.