Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Showing only the best image of each individual


This topic is 5510 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

Posted

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.

Posted

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

This topic is 5510 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.