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.

Characters filter and substitution (syntax help)

Featured Replies

Can you please help me make this syntax work. There probably is more than one thing broken with it... Do any of the characters in the allowedSubset need to be escaped or anything like that?


Let (
    allowedSubset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-[];',{}|"<>?" ;
    fieldArt = (Filter (  myFirstField ; allowedSubset )) ;
    fieldTtl = (Filter (  mySecondField ; allowedSubset )) ;
    mergedString = fieldArt & "_" & fieldTtl;
    Substitute ( mergedString ; ["å";"a"] ; ["é";"e"] ; ["ü";"u"] )
)

1. A quote must be escaped when used as a literal character;

2. You must enclose multiple variable declarations in square brackets;

3. Once you have filtered the components of the merged string to contain only the allowed characters, it cannot contain "å", "é" or"ü" - so the Substitute() part is not doing anything; if you want it to have any effect, you must apply it before the Filter();

4. There is no need for the outer parentheses in  (Filter (  mySecondField ; allowedSubset )).

Let ( [
    mergedString = myFirstField & "_" & mySecondField ;
    preFilter = Substitute ( mergedString ; ["å";"a"] ; ["é";"e"] ; ["ü";"u"] ) ;
    allowedSubset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-[];',{}|"<>?"
    ] ;
    Filter ( preFilter ; allowedSubset )
)

See also:

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

  • Author

...interesting. Thank you

I don't have FM Advanced, from what I gather the linked solution requires one

Since the CF in the link does not involve recursion (the function calling itself), it can be used in a calculation field.

  • Author

Since the CF in the link does not involve recursion (the function calling itself), it can be used in a calculation field.

thanks for the tip

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.