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 to add two search criteria for the same field?

Featured Replies

hi everyone,

i'm working on a search feature that would set a field with two different values (either A or ???, but the script didn't seem work.. Here is my script-

$omitHHnoLetter is a check box field

If ($omitHHnoLetter="Omit HH no letter")

set field (babies::letter = "Yes")

set field (babies::letter = "Letter sent")

end if

The script is recognizing the second criteria (the second criteria seems overriding the first one) So is there a way to combine these two criteria to make both of them valid for the same search? i really am looking for records with the "letter" field equal to Yes or Letter sent. i tried

set field (babies::letter = "Yes" or "Letter sent")

but it didn't work..

Please advice. Thank you!

Qinqin

I find this very hard to follow (see below why), so this is purely guessing:

If [ $omitHHnoLetter = "Omit HH no letter" ]

Set Field [ babies::letter ; "Yes" ]

Else

Set Field [ babies::letter ; "Letter sent" ]

End If

$omitHHnoLetter is a check box field

Hopefully, you don't have a field whose name starts with a "$"??!

Also, a checkbox field can contain more than one value, and the test

CheckboxField = "Some Value"

will fail when the field has "Some Value" checked along with another value/s.

The script is recognizing the second criteria

What second criteria? I see only one criterion here: either $omitHHnoLetter equals "Omit HH no letter" or it doesn't.

set field (babies::letter = "Yes")

That's not a valid syntax for the Set Field[] step.

  • Author

Hi comment. Sorry about the confusion. I meant "two criteria" because there are two conditions for a household that would be considered registered. One is baby::letter = "Yes" and the other would be baby::letter = "DBL"

Either of these would qualify, and that was where I had trouble with. Because I wanted to put conditions/criteria down to define the search, but only the second condition (whichever comes the second) would be recognized.

What I essentially want is to have the "letter" field defined as either "Yes" or "DBL." is there a way to do that?

Any ideas on how I can define two conditions for the same field. Thanks!

I am still not sure I understand what you are after. To find records whose Letter field contains "Yes" or "DBL" you can:

Enter Find Mode []

Set Field [ Babies::Letter ; "Yes" ]

New Request

Set Field [ Babies::Letter ; "DBL" ]

Perform Find []

  • Author

HI sorry about the unclear msg.

I tried using the "new record" line, but since i have other criteria to construct this big search, when i did "new record" it is combining the big search with one registration condition with the other registration condition... ok, let me try to explain it more.. this is just a rough version of my script-

enter find mode[]

set field[...]

set field[...]

if (....)

set field[babies::letter; "Yes"];

set field[babies::letter; "DBL"];

end if

in this case, the search is doing for records that with letter field that is set "DBL" instead of "Yes" or "DBL"

and if I tried

set field[...]; -- other conditions

set field[...];

if (...)

set field[] -- condition 1

new record

set field[] -- condition 2

end if

The search is looking for records that meet the other conditions and condition 1 PLUS those that meet condition 2..

i'm looking at a script to look for records that meet other conditions along with condition 1 and condition 2.

Hope it makes sense.

In this part:

if (....)

set field[babies::letter; "Yes"];

set field[babies::letter; "DBL"];

end if

you are setting the field to "Yes", then canceling what you just did by setting it to "DBL" (and nothing else).

You could set the field to both, but that would only find records that contain both "Yes" AND "DBL". To do an OR search, you must use another request. If you have other criteria to consider, try:

Enter Find Mode []

Set Field [ ... ]

Set Field [ ... ]

Set Field [ ... ]

...

#

If [ ... ]

Set Field [ Babies::Letter ; "Yes" ]

Duplicate Request

Set Field [ Babies::Letter ; "DBL" ]

#

Perform Find []

I'm sure Comment has you covered but I would also question ... what is your If[] test while in find mode? If it involves field values, it will fail because fields/records have no value in find mode.

  • Author

Thank you, comment! Duplicate Record was what I needed.. :) It works now.

Thanks again.

  • Author

Hi :) Thanks for asking about my find feature. I used some if statements to include search criteria where users choose to apply during their search. There are check boxes in my user interface asking people if they want to include premature babies or households that have not been given regsitry permission and such in their search..

It works so far.. Thanksfully..

  • 3 months later...

Hi :) Thanks for asking about my find feature. I used some if statements to include search criteria where users choose to apply during their search. There are check boxes in my user interface asking people if they want to include premature babies or households that have not been given regsitry permission and such in their search..

It works so far.. Thanksfully..

I don't know if you've found a permanent answer to your question, but the way we solve this problem is:

Set Field [saying; "Hi"]

Perform Find []

Set Field [saying; "Goodbye"]

Extend Found Set []

In this example, it will search for both "Hi" and "Goodbye" in the field labeled "Saying".

Hope this helps.

- Dan

Why not simply use two requests and one find - as suggested above?

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.