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.

Replacing Tokens In Stylized Text

Featured Replies

Hello,

I have a problem I'm hoping someone has a solution for with FileMaker 6.

Essentially I'm trying to implement a mail merge type situation where an editable text field contains tokens/markers that later get replaced with other field values from the database.

This editable field contains text of varying styles (some bold, underline, centered, etc.). If I use the Substitute() function:


Insert Calculated Result[select, "fTextField", Substitute(GetField("fTextField"), "%TOKEN1%", GetField("fToken1"))"]

the markers are replaced as expected BUT I lose all of the styled text.

I'm looking for a cross-platform solution (it HAS to run on Mac and Win) that could work in FM 6, with or without plug-ins. I know this all works fine in FM 7 but I'm trying to avoid migrating to FM 7 at the same time unless I have absolutely no other choice.

Ideas anyone?

Get Filemaker 7 and make sure you get the developer version. Then go to the custom functions area here and look at the FieldSubstitute custom function.

In FM6, if you have to have different parts of the text styled differently, I think you will have to use real merge fields in a text object. frown.gif

The Find/Replace function in FMP 6 preserves character formatting. It can be used to merge codes instead of using the Substitute() function. You'll need to copy/paste the template text into a field, then run the Replace script over the text to merge it.

Both of these processes are layout dependent (the fields need to be on the current layout when the copy/paste and Replace steps run).

  • Author

Hi Vaughan,

Thanks for the tip. Unfortunately that doesn't get me all the way there as the Copy/Paste script steps blow away the 'centered' formatting on some of the text in the field (the bold, underline, etc. styles come across fine however). The Find/Replace part does work as expected.

Oh well. *So* close. I guess it's on to FM 7...

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.