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.

Showing only the best image of each individual

Featured Replies

I have a database of manta rays with 290 individuals, all with unique ID's. Each individual has multiple photos in a "child" table showing various attributes of that animal. The photos are identified as primary or secondary. Each individual has one primary photo (the best photo) and multiple secondary photos. I would like the parent layout to show the individual ID and ONLY the primary photo.

Would I need to script this or can it be done with an "if then" calculation (if photo status = primary, then...)? Because of the parent-child relationship, I'm not sure how to do this.

This layout will be used to match new manta ray photos to the catalog.

Make a new relationship called "primary photo for individual" which is based on:

individuals::UniqueID = photos::IndividualID

AND

individuals::_1 = photos::IsPrimaryPhoto

where

"individuals::_1" is a calculation field which is set simply to =1, ie always contains the number "1".

and

"photos::IsPrimaryPhoto" is a field (either a number field, or an indexed calculation field) which contains the number "1" if the photo is the primary one.

Display the photo through that relationship and you will always have the primary one.

Hope that helps.

James

There are a few ways to handle this but both would require using a relationship to restrict the child records to the one primary photo.

Method #1: Calculation in child photo table, called PrimaryID with:

Case ( Photos::Status = "Primary" ; ParentID ).

Then create a new relationship from this new PrimaryID field to your Parent::ParentID (called Primary Photo).

Method #2: Calculation (unstored, text) called cWordPrimary in Parent with:

"Primary"

Then create a new relationship to Parent using two fields as:

Parent::ParentID = Primary Photo::ParentID

AND

Parent::cWordPrimary = Primary Photo::Photo Status

In both methods, you don't need a child portal on your parent layout to hold the photo - just place the photo itself (from its respective child relationship) directly on the parent layout because there is only ONE related child record now.

I prefer method #1.

In case you are wondering, LaRetta's method 2 works in exactly the same way as my suggestion, except that it makes the link between the two tables using the word "Primary" instead of the number "1".

J

  • Author

Sweet, works great. I love this forum and how quickly feedback is provided. Thanks a bunch!

Mark

Glad it worked for you. Post again if you need anything else.

J

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.