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.

Changing AND to OR in "Edit Find Request"

Featured Replies

I have the following fields in a table (classical music):
Category
Category 2
instrument 1
instrument 2
instrument 3
instrument 4
I would like to make a script that export to the following conditions:
IF "category" OR "category 2" contains "Instrument" then output the contents of "Instrument 1", "Instrument 2", "Instrument 3" and "Instrument 4".

If I add two or more conditions the default is AND. How do I change this to OR?

and_or.jpg

Edited by Kurt Hansen

Do it as two find requests, rather than combining them in one as per above.

The Perform Find would look like:

Cheers

 

Webko

Screen Shot 2016-08-18 at 3.15.14 pm.png

35 minutes ago, Kurt Hansen said:

IF "category" OR "category 2" contains "Instrument"

This problem is a symptom of another. Any time you find yourself numbering your fields, like "Category 1", Category 2", etc. you should consider using a related table instead. Even a repeating field, or a single field formatted as checkboxes, would be preferable to what you have now.

  • Author
44 minutes ago, webko said:

Do it as two find requests, rather than combining them in one as per above.

Thanks, Webko, but...!

I want it to output only if "Kategori" or "Kategori 2" contains the word "Instrument". My test (see attachments) doesn't do that.

Example: Catalog number BRIDGE 9450 outputs "Kammermusik   Klaver   Klaver   Klarinet    Fagot".

In my database "Kategori" contains "Kammermusik" and "Kategori 2" contains "Instrument".

dump1.jpg

dump2.jpg

5 minutes ago, Kurt Hansen said:

My test (see attachments) doesn't do that.

Why does your test have four find requests instead of the suggested two?

  • Author
10 minutes ago, comment said:

This problem is a symptom of another. Any time you find yourself numbering your fields, like "Category 1", Category 2", etc. you should consider using a related table instead. Even a repeating field, or a single field formatted as checkboxes, would be preferable to what you have now.

Yes, comment, I believe that, but it would be quite a work for me to "split" my data into two tables. I have 35.000 records in my current flat database AND I'm a novice ;-)

Just now, Kurt Hansen said:

it would be quite a work for me to "split" my data into two tables.

Not really. It can be scripted, you know.

  • Author
7 minutes ago, comment said:

Why does your test have four find requests instead of the suggested two?

I'm sorry, I do not know. It is as I had seen the proposal. Which 2 of the 4 should I keep?

[Edit] Ok, comment. I'm working and I think I'm going the reght way now.

Edited by Kurt Hansen

3 minutes ago, Kurt Hansen said:

Which 2 of the 4 should I keep?

If you want to search the "Kategori" and"Kategori 2" fields, then those are the requests you should keep (#1 and #3 in your screenshot).

I am a little confused by your original requirement:

1 hour ago, Kurt Hansen said:

IF "category" OR "category 2" contains "Instrument" then output the contents of "Instrument 1", "Instrument 2", "Instrument 3" and "Instrument 4".

The result of performing a find is a found set of records. It does not "output" any particular fields. Does your find need additional criteria regarding the "Instrument" fields?

  • Author
Sorry folks, but this is too complicated for me. I give up :(

Edited by Kurt Hansen

Why don't you try an easier (IMHO) way:

Enter Find Mode [  ] 
Go to Layout [ “YourTable” ] 
Set Field [ YourTable::Category; "instrument" ] 
New Record/Request 
Set Field [ YourTable::Category2; "instrument" ] 
Perform Find [  ] 

Note that no find requests are specified for the Enter Find Mode [ ] or Perform Find [ ] steps.

 

 

Comment,

I see you go into find mode before switching layouts. I assume you are doing this to prevent the new layout from retrieving records that are not needed for the task at hand but could the same thing be accomplished with Freeze Window as the first step?

Just curious. 

  • Author
On 18/8/2016 at 1:12 PM, comment said:

Why don't you try an easier (IMHO) way:


Enter Find Mode [  ] 
Go to Layout [ “YourTable” ] 
Set Field [ YourTable::Category; "instrument" ] 
New Record/Request 
Set Field [ YourTable::Category2; "instrument" ] 
Perform Find [  ] 

Note that no find requests are specified for the Enter Find Mode [ ] or Perform Find [ ] steps.

How do I select two fields in line 3 and 5?

5 minutes ago, Kurt Hansen said:

How do I select two fields in line 3 and 5?

Why would you need to?

  • Author

As I (mis)understand you(?) I must select both "Category" + "Instrument" (and "Category" + "Instrument"). My database is flat with only one table. I havn't got tables called "Category" and "Categori 2".

14 minutes ago, Kurt Hansen said:

My database is flat with only one table. I havn't got tables called "Category" and "Categori 2".

You must use fully-qualified field names in a script, in the format of TableName::FieldName. My script presumes your table is named "YourTable" - replace this part with your real table name.

 

14 minutes ago, Kurt Hansen said:

I must select both "Category" + "Instrument" (and "Category" + "Instrument").

I don't understand this part. Do you also want to search the Instrument field (or rather fields, since you have 4 of them)?

 

Note that this is the same question I asked earlier:

On 08/18/2016 at 9:22 AM, comment said:

I am a little confused by your original requirement:

...

Does your find need additional criteria regarding the "Instrument" fields?

 

 

Edited by comment

  • Author

Please see attachment. How to select? My table has the name "Varer" and "Category" is "Kategori" in Danish.

[ YourTable::Category; "instrument" ]

New Script.jpg

7 minutes ago, Kurt Hansen said:

How to select?

Just click OK and Filemaker will insert the field name for you. It will look like this: Varer::KATEGORI. Then click the Calculated result: Specify button and enter the text "instrument" (including the quotes) as the calculation formula.

These are basic script operations; you should know them after having done the tutorial and/or consulting the help.

  • Author
29 minutes ago, comment said:

Just click OK and Filemaker will insert the field name for you. It will look like this: Varer::KATEGORI. Then click the Calculated result: Specify button and enter the text "instrument" (including the quotes) as the calculation formula.

These are basic script operations; you should know them after having done the tutorial and/or consulting the help.

Aha! Got it. Thanks.

Yes I know that I should (...) but my needs are very modest and irregular; usually just a few times a year. I am not unwilling to make an effort itself, but my experience is that even a very conscientious review of a tutorial is not stored in my memory, so I can remember it next time.

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.