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.

specifying "wild cards" in a calculated field

Featured Replies

Hi to all the FMers,

Very nice job on the new forum look, BTW.

The question is: how do I script something like:

case(field1="on@", "1",

field1="tw@", "2",

field1="thre@", "3",

field1="f*", "4", "no number")

In other words, instead of hardcoding the litterals, can I use the same wild card symbols available in Find Mode for searching? This would alliviate considering all the litteral possibilities, and hardcoding them in a calculated field.

Thanks

Well, the way you have it you are almost entering all the information anyway as it will only return the one result

But, if you want to find that text within a field and return a specific number then you could try

Case(

PatternCount( field1, "on"),1,

PatternCount( field1, "tw"),2,

PatternCount( field1, "thre"),3,

PatternCount( field1, "f"),4,

"")

Then if it falls anyware in that field it will return the number.

Is this what you want?

I'm not sure of you question but if you want wild cards in you scripted searchs you'd do somthing like this:

Enter Find Mode[]

SetField [ SearchField, "Otherfield & "*"]

Perform Find

Just remember, if you are using Find mode in a script to enter the Filemaker find symbols, its best to use the InsertCalculatedResult. SetField relies on the data being the same format as the destination field - so for finding dates which fall within a range, for example, you should use this script:

Enter Find Mode[]

InsertCalculatedResult[Date, DateToText(Date1) & "..." & DateToText(Date2)]

Perform Find[]

A SetField step containing "DateToText(Date1) & "..." & DateToText(Date2)" would not work in this case because the result is not a date format.

  • Author

I guess my question was: Can I use wild cards in the calculated fields rather than in a script, and from your answer I understand that I can not.

I could write that script, and than make it run on opening the file, but that would be annoying to those that don't need to see these code fields.

Thanks for your help.

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.