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.

how do I write a simple find script?

Featured Replies

I am having difficulty writing what I thought was a simple find script. I am using a single database to keep track of our widgets. We have two different types of widgets, incoming widgets and outgoing widgets and all of the widgets have a unique name.

I have assigned one field (NAME) to contain the unique names of the widgets and one field (WHOM) to contain to whom the widget was sent (if it is incoming I enter "us" in that field if it is outgoing I enter "Joe" or "Acme Corp." or "The Andersons" etc).

I would like to create a script that performs a find in the NAME field that first filters out all of the "us" widgets from the WHOM field.

I would also like to create a script that performs a find in the NAME field that first filters out everything EXCEPT for the "us" widgets from the WHOM field.

Please keep in mind if/when you respond I don't know the FIRST thing about writing a FM script. I clicked away in the script manager and tried many variations. I've read a good bit of The Missing Manual but I still have almost no idea what most of any of it means.

To take a current found set of names and then you want to constrain it by a script in which the Whom field is "us":

Enter Find Mode

Set Field [ Whom; "us" ]

Constrain Found Set

To take a current found set of names and then you want to constrain it by a script in which the Whom field is NOT "us":

Enter Find Mode

Set Field [ Whom; "us" ]

Omit Record

Constrain Found Set

  • Author

Oh this is fantastic!! Thank you VERY much! Perfect!

  • Author

Whoops! I spoke too soon. The first script in which the Whom field is "us" I get one of two results. If I remove the pause in the Enter Find Mode step then I cannot enter the Name of the widget and the script found set is every single widget sent to "us". If I remove the pause in the Enter Find Mode step it allows me to enter the name of the widget but I will get a warning saying "no records match this set" even though there are records that match that set.

Based on your first post, I thought that you would be manually searching for a widget, returning a found set, and then hitting a button to constrain the set to only those in the US or not in the US.

  • Author

Sorry I should have explained myself better.

I would like to write a script so that when I click a button a situation is created where I can input the name of the widget to be found and the script will automatically cull it's finding(s) from the US set.

The other button would omit findings from the US set.

I hope that's clearer. Thank you for your patience and help with this.

Let say you have the following records.


ID	Name	Whom

1	John	us

2	Bob	us

3	Mary	them

4	Kelly	us

5	Rob	us

6	John	other

7	John	us

8	Cindy	them

9	John	them







First one:



Enter Find Mode [Pause]   // Enter manual criteria "John"

Set Field [ Whom; "us" ]

Perform Find []



Will return



1	John	us

7	John	us









Second One:



Enter Find Mode [Pause]   // Enter manual criteria "John"

New Record/Request

Set Field [ Whom; "us" ]

Omit Record

Perform Find []





Will return



6	John	other

9	John	them

  • 3 months later...

Thanks for your post mr_vodka. I have been wondering how to do omit case for ages. I am no newb but didn't put together the idea of running the omit step before the find step. I was always thinking it would be a check box on the find step and that this was some fm blind spot or something!

Thanks again.

Michael

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.