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 script to identify records with similar IDs

Featured Replies

  • Newbies

Hello,

I'm very new to Filemaker and am having trouble coming up with a script for locating previous records with entries in an ID field that are similar to the current entry. I have only seen threads about identifying duplicate records or using multiple fields to locate similar records.

Here's the background for my problem. My database contains records of salamander captures, where each salamander is given a unique "code" (or ID) that allows it to be identified when it is re-located in the future (to track growth rates, movement, etc...). Each code is a unique color-position combination and each salamander is generally given up to five colored marks in any of six positions. The colors used are pink, orange, and yellow. Positions are numbered 1 through 6. A list of codes would look like this 5o25y, 12o16y, 1o1y, 1o1y, 12o46y, 12p6y, etc... A 1o12y code can be interpreted as "an orange mark in the first position and a yellow mark in the first and second positions." Pink always comes before orange, which comes before yellow. When an animal is re-captured, the code for the new record adds a letter "R" at the end: 5o25yR, 12o16yR, etc...

The problem is that codes are sometimes mis-read when an animal is re-located. As a first step, I created a button in my layout that performs a script to identify records with the exact same code. The script causes a new window to pop out which lists the current record for an individual as well as all previous records which match that code. This verifies that an animal was correctly identified. The Perform Find command searches for records with a matching code for that location and species (codes are recycled in different areas and for different species).

Freeze Window

If[PatternCount (MRC::Code;"R")=1]

New Window []

View As [View as List]

Set Variable [$Species; Value:MRC::Species]

Set Variable [$HU; Value:MRC::Harvest Unit]

Set Variable [$Code; Value:Left(MRC::Code;(Length(MRC::Code)-1))]

Go to Layout ["Code Check" (MRC)]

Perform Find [Restore]

End If

My question is whether anyone has an idea for how to search all records for codes which have similar character matching. When a salamander is initially mis-identified (no matching records found), it would be helpful to have a list of the records with the closest matching codes. At the moment, I would need to perform a number of permutations of relaxed searches (using the @, #, or * operators) to identify salamanders with similar codes and keep track of possible options.

The most likely case is that a color mark is overlooked or has been lost. A code of 12o3yR which has no previous matching records could be searched for using 12@o3y, 12o@3y, 12o@@3y, 12o@3@y, 12o3@y, 12o3@@y. Occasionally, a mark migrates (changes position) so that 12o3yR could also match previous #2o3y, 1#o3y, or 12o#y records. Having more than one error is probably highly unlikely.

Is there a way to cycle through all of these possible relaxed searches to generate a list or simply find other records with code entries where most of the characters are shared with the code of the current record?

Thanks in advance for any help! I hope I'm not overlooking anything too simple.

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.