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.

Best Database Structure

Featured Replies

Hi All,

What would be the best structure to use when you want to create a portal that

shows records from the same table which are related. I know you can do a

self join, but I believe this is more complicated and I have become quite

confused.

I am trying to set up a recipe database which as part of its function identifies

ingredient pairs which are good matches. I intiially set up a filemaker seven

database which several tables, two of which were "ingredient" and

"flavorPals". I created a relationship in filemaker 7 beween the primary key

field in the "ingredient" table ("zk_ingredientId_p") and the foreign key field

("zk_ingredientIds_f" in the "flavorPals" table. The foreign key field was a

multi-line key which was set by a script to place the key of ingredient1 on the

first line and ingredient2 on the second line.

I then set up a third TOG called "flavorPals_info" which was a representation

of the "Ingredients" table and created a relationship from the "flavorPals"

table using a relationship identical to the one described above.

I set up a portal on the ingredient layout to show the flavor pals. My intent in

doing so was to display info about all the ingredient's related to the one

being displayed. Unfortunately, it seems I have set up the sturcture wrong,

because it does not seem to be working right.

What I want to have happen is to show the other ingredient when any of the

ingredient's are showing. For example, if I have thyme and basil, I want to

show basil as a match when thyme is selected and show thyme as a match

when basil is selected.

Any suggestions would be very much appreciated. Thanks in advance.

Don

Welcome Don!

This sounds like an interesting project. Structurally, it is the same as a Node-Path model I have played around with, where a Path is defined between two Nodes, and you want to see the reverse path show up upon creation.

For a relationship to work from "Basil" to "Thyme" and from "Thyme" to "Basil", two join records must be created in FlavorPals, one for each direction. Unfortunately, creating one related FlavorPal record cannot automatically create the second FlavorPal record needed for the reverse relationship.

What I have done to make this work is use a global data entry field for the To node, and used a script to populate both join records at the same time.

  • Author

Hi Ender,

Thanks for your suggestions. I will try that.

Don

  • Author

Ok, one addtional question,

I can see how that would work great, the only problem is what if you want to use a script to delete the match? For example, I have a button in the portal next to the match to delete the related record. How do you get the script to find both copies of the match to delete them?

Don

  • Author

Hi Ender,

I wanted to check back and say thank your for your help.

Don

I'm glad you found it useful.

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.