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.

Multiple "And" Find Script

Featured Replies

Hello,

I have a table named Food where I list several food characteristics.

Relevant Food table fields:

__kpFoodID

FoodName

FoodCategory

FoodSubCategory

BloodTypeASecretor

BloodTypeANonSecretor

BloodTypeBSecretor

BloodTypeBNonSecretor

BloodTypeABSecretor

BloodTypeABNonSecretor

BloodTypeOSecretor

BloodTypeONonSecretor

So, depending on the persons BloodType and wether he/she is Secretor or Non Secretor a particular Food can be: Avoid (detrimental), Beneficial, Neutral.

My final objective is to have four types of food report, one for each blood type, based on the food suitability: Avoid, Beneficial, Neutral

FOOD REPORT

BLOOD TYPE:

Avoid Beneficial Neutral

Food Category Food Category Food Category

Food SubCategory Food SubCategory Food SubCategory

FoodName FoodName FoodName

So I need 4 scripts, one for each blood type, that will find and sort the records. Finally, I will associate each script to its button: A Type Food, B Type Food, AB Type Food, O Type Food.

I have a working Find and Sort script based on just one criteria for each blood type.

So, for the A Blood Type I have the following script to find out the "Beneficial" foods:

Find_BT_A_Beneficial script is the following

Enter Find Mode [ ]

Set Field [ Food::BloodTypeASecretor; "Beneficial" ]

New Record/Request

Set Field [ Food::BloodTypeANonSecretor; "Beneficial" ]

Set Error Capture [ On ]

Perform Find [ ]

Perform Script [ “Food Record Sorting”]

Food Record Sorting Script:

Enter Browse Mode

Go to Layout [ “Alimentos Recomendados” (Food) ]

Sort Records [ Specified Sort Order: FoodCategory::FoodCategory; ascending FoodSubcategoy::FoodSubcategory; scending Food::FoodName; ascending ]

[ Restore; No dialog ]

Enter Preview Mode [ Pause ]

Enter Browse Mode []

Go to Layout [ original layout ]

I would like to be able to modif ythe Find_BT_A_Beneficial script so that it finds and sorts all the food records that are: Avoid, Beneficial & Neutral for both Blood Type A Secretors and Blood Type A NonSecretors.

Since I have tried without success some modifications, my question is:

How can I modify the Find_BT_A_Beneficial script so that the found set includes:

Foods to Avoid & Beneficial & Neutral for the Secretor Blood Type A

&

Foods to Avoid & Beneficial & Neutral for the NonSecretor Blood Type A?

Thanks

It would probably be best to have another table with the following fields:

• FoodID

• BloodType

• Secretor (Boolean)

• Compatibility (Avoid/Beneficial/Neutral)

IIUC, it would have 8 related records for each food (4 blood types * 2 secretor categories). This would enable you to easily produce any type of report you can possibly imagine - including reports that need to list the same food twice (which is not possible with your current structure).

How can I modify the Find_BT_A_Beneficial script so that the found set includes:

Foods to Avoid & Beneficial & Neutral for the Secretor Blood Type A

&

Foods to Avoid & Beneficial & Neutral for the NonSecretor Blood Type A?

Doesn't this include all records?

  • Author

Hello Comment,

Thanks for looking into my question.

You are right I will have to undo my current structure and create the table that you suggest.

Doesn't this include all records?

No. It just includes all the records as for the Blood type A.

WIth my current structure for a particular Food record, you can generate 4 general report groups:

Food records that are Avoid (detrimental), Beneficial, and Neutral for people with blood type A.

Food records that are Avoid (detrimental), Beneficial, and Neutral for people with blood type B.

Food records that are Avoid (detrimental), Beneficial, and Neutral for people with blood type AB.

Food records that are Avoid (detrimental), Beneficial, and Neutral for people with blood type O.

Thanks again for providing a useful point of view.

  • Author

Thinking twice,

Doesn't this include all records?

Yes, but organized as to their suitability for the blood type A people.

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.