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 multiple words in Value List

Featured Replies

Hi Folks,

 I hope you're all well.

I'm trying to use a Find step in a script, to find multiple words from a Global field checkbox in a field in the same table.

It works fine when just one word is selected, but fails when two or more are. I've tried different operators, but = and == don't work either.

Is it possible to get this kind of thing to work, or is it only do-able in related tables?

-------------------------

hmmm, having asked the question, I suppose I could separate the list into it's different words, give each a variable and Find for each variable. There are only three possible words so a max of three variables to set. Can't remember the text function off the top of my head, but pretty sure it's possible. Is there a sleeker way?

Best wishes!

Mike

Edited by MikeKD
typo

You shouldn't have to do anything special to find multiple words. Have you tried it with no operators? It could be an issue with your script, can you post it? And could you give an example of the actual data?

Basically you are declaring: you tried something and it didn't work.

What exactly does your script look like? Since you have return-separated values (from a checkbox field) you are going to have to create multi-step script.

  • Author

Thanks for the quick replies. I've attached the script below.

Each record has a Term field which is set to either Autumn, Spring or Summer.

I've set a global checklist to select any one, two or three of them.

It looks like it's searching for a field with both / all three words when more than one is selected in the global.

Hope that helps clarify a little!

ScriptImage.bmp

  • Author

I've now split the one variable into three; one for each word using the middle words function.

Is there are way to Find OR in Specify Find Requests - there seems to be no option other than AND; and no way of bracketing Find Requests.

Apologies for the questions; I've always had to use trial and error with Edit Find Requests before, and at the moment, it's mainly error despite going through the books & searching the forum..

Cheers!

Mike

To perform OR logic, you must separate the requests.

For compound finds such as this, I prefer to script them without using the Restore feature. It gives me much more granular control, and keeps the find criteria more accessible when troubleshooting/rereading the script.

Enter Find Mode []
Set Field [template::year[]; 2018]
Set Field [template::InParentDiary; 1]
Perform Find []
Set Field [template::season[]; "spring"]
New Record/Request
Set Field [template::season[]; "summer"]
Constrain Found Set []

The New Record/Request step performs the OR function; the Constrain Found Set step pulls those criteria from the 2018 found set.
 

Use a calculation using the FilterList command to replace the literal seasons shown with checkbox items.

 

Edited by doughemi

Doug, there is a very important omission in your script. After the first Perform Find, you need to re-enter Find Mode.

Otherwise; you're changing data in the current record.

And you probably want to add some error trapping.

Also: not sure what's up with your square brackets in the set field statements. I removed them here.
 

Enter Find Mode [] 
Set Field [template::year ; 2018]
Set Field [template::InParentDiary; 1] 
Set Error Capture [ On ] 
Perform Find [] 
If [ get( lastError) = 0 ] 
Enter Find Mode [] 
Set Field [template::season ; "spring"] 
New Record/Request 
Set Field [template::season ; "summer"] 
Constrain Found Set [] 
End If

 

Edited by BruceR

Thanks, Bruce, for the correction.

The square brackets are stuck in there somehow by Clip Manager, and I forgot to edit them out.

  • Author

Thanks guys!

I'll try to have a go at it today and see how it works - I think it's the New Record / Request step I've not used in that way before that I'll have to research a bit first..

Best wishes,

Mike

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.