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.

Searching exact matches within a field

Featured Replies

  • Author

OK, so I am probably making this harder than it should be, but here is the scenario.

I have a button called, "affiliate": when you click this button it is supposed to search all the records within the table for all exact matches of the affiliate under the "affialates" field.

For example, I am on record #33526 and the affiliates field is eg. "Pizza Hut" (The one in your hometown for an address). When I click the affiliate button, i want to do a find for all the "Pizza Huts" in my database and return them in a table view?

How do i do this?

I am using a script "perform find" but my criteria is wrong?

Please help

Thanks

OK, so I am probably making this harder than it should be, but here is the scenario.

I have a button called, "affiliate": when you click this button it is supposed to search all the records within the table for all exact matches of the affiliate under the "affialates" field.

For example, I am on record #33526 and the affiliates field is eg. "Pizza Hut" (The one in your hometown for an address). When I click the affiliate button, i want to do a find for all the "Pizza Huts" in my database and return them in a table view?

How do i do this?

I am using a script "perform find" but my criteria is wrong?

Please help

Thanks

  • Author

OK, so I am probably making this harder than it should be, but here is the scenario.

I have a button called, "affiliate": when you click this button it is supposed to search all the records within the table for all exact matches of the affiliate under the "affialates" field.

For example, I am on record #33526 and the affiliates field is eg. "Pizza Hut" (The one in your hometown for an address). When I click the affiliate button, i want to do a find for all the "Pizza Huts" in my database and return them in a table view?

How do i do this?

I am using a script "perform find" but my criteria is wrong?

Please help

Thanks

Copy [affiliates]

Enter Find Mode

Insert Text [affiliates =]

Paste [affiliates]

Perfom Find

Note the addition of the inserted "="

Copy [affiliates]

Enter Find Mode

Insert Text [affiliates =]

Paste [affiliates]

Perfom Find

Note the addition of the inserted "="

Copy [affiliates]

Enter Find Mode

Insert Text [affiliates =]

Paste [affiliates]

Perfom Find

Note the addition of the inserted "="

  • Author

thank you dwins, i tried it out and it works about 90% the way i want it too. I need an exact match...

with what you gave me i tested it using "hilo" in a few records and "hilooo" in a record and when i clicked the button to perform the script both "hilo" and "hiloo" showed up....can i do an exact match this way or no?

  • Author

thank you dwins, i tried it out and it works about 90% the way i want it too. I need an exact match...

with what you gave me i tested it using "hilo" in a few records and "hilooo" in a record and when i clicked the button to perform the script both "hilo" and "hiloo" showed up....can i do an exact match this way or no?

  • Author

thank you dwins, i tried it out and it works about 90% the way i want it too. I need an exact match...

with what you gave me i tested it using "hilo" in a few records and "hilooo" in a record and when i clicked the button to perform the script both "hilo" and "hiloo" showed up....can i do an exact match this way or no?

Copy and Paste are layout dependent (the fields must be on the current layout when the script is performed) and using them like this destroys the contents of the clipboard (of which the user took trouble to put there). There are ways to save the clipboard, but nothing beats avoiding the problem altogether! This soultion requires a global field to store the search criteria... gAffiliates:

Set Field [ gAffiliates ; affiliates ]

Enter Find Mode []

Set Field [ affiliates ; "==" & gAffiliates ]

Perform Find []

Note that the "==" prepended to the search criteria forces an exact field content match.

Set Field only works if the calculated string is valis for the field's data type, so it won't work for dates because ">1/1/2005" is not a valid date. In this case the Insert Calculated Text step will do the job, but this is layout dependent. In this case the script would be...

Freeze Window

Set Field [ gAffiliates ; affiliates ]

Enter Find Mode []

Go to Layout [ <layout with field on it> ]

Insert Calculated Result [ affiliates ; "==" & gAffiliates ]

Go to Layout [ original layout ]

Perform Find []

Copy and Paste are layout dependent (the fields must be on the current layout when the script is performed) and using them like this destroys the contents of the clipboard (of which the user took trouble to put there). There are ways to save the clipboard, but nothing beats avoiding the problem altogether! This soultion requires a global field to store the search criteria... gAffiliates:

Set Field [ gAffiliates ; affiliates ]

Enter Find Mode []

Set Field [ affiliates ; "==" & gAffiliates ]

Perform Find []

Note that the "==" prepended to the search criteria forces an exact field content match.

Set Field only works if the calculated string is valis for the field's data type, so it won't work for dates because ">1/1/2005" is not a valid date. In this case the Insert Calculated Text step will do the job, but this is layout dependent. In this case the script would be...

Freeze Window

Set Field [ gAffiliates ; affiliates ]

Enter Find Mode []

Go to Layout [ <layout with field on it> ]

Insert Calculated Result [ affiliates ; "==" & gAffiliates ]

Go to Layout [ original layout ]

Perform Find []

Copy and Paste are layout dependent (the fields must be on the current layout when the script is performed) and using them like this destroys the contents of the clipboard (of which the user took trouble to put there). There are ways to save the clipboard, but nothing beats avoiding the problem altogether! This soultion requires a global field to store the search criteria... gAffiliates:

Set Field [ gAffiliates ; affiliates ]

Enter Find Mode []

Set Field [ affiliates ; "==" & gAffiliates ]

Perform Find []

Note that the "==" prepended to the search criteria forces an exact field content match.

Set Field only works if the calculated string is valis for the field's data type, so it won't work for dates because ">1/1/2005" is not a valid date. In this case the Insert Calculated Text step will do the job, but this is layout dependent. In this case the script would be...

Freeze Window

Set Field [ gAffiliates ; affiliates ]

Enter Find Mode []

Go to Layout [ <layout with field on it> ]

Insert Calculated Result [ affiliates ; "==" & gAffiliates ]

Go to Layout [ original layout ]

Perform Find []

... along Vaugan's lines, there is nothing like putting a "variable" global field of each type (text, number, date, container) in a database (or table, in the FMP7 lingo) in advance, to use for these types of situations. The situations arise more often than expected, and the fields are always useful. The bonus is that they do not take up much space if not used, and if they are not used, they are easily removed from the system...

-Stanley

... along Vaugan's lines, there is nothing like putting a "variable" global field of each type (text, number, date, container) in a database (or table, in the FMP7 lingo) in advance, to use for these types of situations. The situations arise more often than expected, and the fields are always useful. The bonus is that they do not take up much space if not used, and if they are not used, they are easily removed from the system...

-Stanley

... along Vaugan's lines, there is nothing like putting a "variable" global field of each type (text, number, date, container) in a database (or table, in the FMP7 lingo) in advance, to use for these types of situations. The situations arise more often than expected, and the fields are always useful. The bonus is that they do not take up much space if not used, and if they are not used, they are easily removed from the system...

-Stanley

In version 7, you can:

Enter Find Mode [ ]

Set Field [ Table::Datefield; ">1/1/2005" ]

In version 7, you can:

Enter Find Mode [ ]

Set Field [ Table::Datefield; ">1/1/2005" ]

In version 7, you can:

Enter Find Mode [ ]

Set Field [ Table::Datefield; ">1/1/2005" ]

  • Author

how do i do this? i cant get this to happen?

Set Field [ gAffiliates ; affiliates ]

I cant use the semi-colon in there?

  • Author

how do i do this? i cant get this to happen?

Set Field [ gAffiliates ; affiliates ]

I cant use the semi-colon in there?

  • Author

how do i do this? i cant get this to happen?

Set Field [ gAffiliates ; affiliates ]

I cant use the semi-colon in there?

In ScriptMaker, select the Set Field step.

There are two buttons at the lower right corner. Click on the top one, and select the target field. Click on the bottom one and enter a calculated result - this will put into the target field.

When you're done, the Set Field step will reflect your choices. It will look like:

Set Field [Table::Targetfield; Calculation].

In ScriptMaker, select the Set Field step.

There are two buttons at the lower right corner. Click on the top one, and select the target field. Click on the bottom one and enter a calculated result - this will put into the target field.

When you're done, the Set Field step will reflect your choices. It will look like:

Set Field [Table::Targetfield; Calculation].

In ScriptMaker, select the Set Field step.

There are two buttons at the lower right corner. Click on the top one, and select the target field. Click on the bottom one and enter a calculated result - this will put into the target field.

When you're done, the Set Field step will reflect your choices. It will look like:

Set Field [Table::Targetfield; Calculation].

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.