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.

Find exact match in a check box field problem

Featured Replies

Hi all,

This problem was addressed before by other users on this forum but the solutions where not successfull or at least they would not work in my case so i will try to be very clear about it

In my database is a field called "Tagging"

 

This is a check box field that could have more values such as:

Recurrent 2013

Recurrent 2014

Misc 2014

TRTO

TRTO-Performance

... and so on.

I set a variable $tagname with a value form one table and the find is performed in another table.

FIRST ISSUE - When I do a search in a script for $tagname ( value TRTO-Performance ) it is working as expected.
However when I perform this find for TRTO it also finds TRTO-Performance and that is not ok.

 

SECOND ISSUE - When i searc for "Recurrent 2014" it will also give me the records where Recurrent 2013 AND Misc 2014 are checked.

In the find dialog I can set the criteria to ==$tagname (or "=="&$tagname) but that DOES NOT WORK BECAUSE FM is searching for the exact value "$tagname" in the field containing some other values (checkbox set).

 

Is there a way to search for the exact frase within multiple frases and still use the variable for this search.
Thanx for your help.

I suspect your variable is not being created properly. normally if you were to search "recurrent" it would find both 2013 and 2014. However searching for "recurrent 2014" would only return the records you want.

 

Perhaps viewing the variable in the data viewer might help.

  • Author

Hi, thank you.

If there was only one value in the field this would happen, but there are 2 VALUES IN THE FIELD:

 

MISC 2014

Recurrent 2013

 

SO even with the correct variable which is "Recurrent 2014" it brings each field where this MISC 2014 is inside the field with Recurrent 2013.

It does not bring the other fields with "Recurrent 2013" ONLY the fields where there is another value containing 2014 as well.

 

I am trying hard to figure out how to make the script search just for the exact value among the different check box values, regardless of where it might be positioned in the array of values.

I am trying hard to figure out how to make the script search just for the exact value among the different check box values, regardless of where it might be positioned in the array of values.

 

Does "trying hard" include reading the help?

http://www.filemaker.com/13help/en/html/find_sort.5.6.html#1050963

 

Just place the search phrase between double quotation marks.

  • Author

:) Thanks, yes that is what i am trying to do and it would work for me, so this is very close to the correct solution. However, i am having trouble inserting variable value inside the double quotation mark and using it in the "Find..." script, it clears the quotation mark and gives me just the value in the search field, which is no good.

 

I tryed the following combinations none of them worked ($tagname is the name of the variable that i need to use in the search):

Set Field ... ""&$tagname

Set Field... ""&$tagname&""

Set Field... " "&$tagname

 

and so on... Whatever i put it returns only a variable in the search field without quotation marks. I am looking for the a way to do this with the variable value inside the double quotation marks in the search proceedure, like i would do it if i wanted to search manually for the exact frase. Help please...

You need to escape the quotes. Try =

""" & $tagname & """

or simply =

Quote ( $tagname )

Note: these two are not strictly the same; if $tagname contains any special characters, the Quote() function will escape them.

  • Author

YES, this finally works just as expedted, both of the methods achieve the desired result.

Thank you a milion comment, you saved my day.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.