FileMaker Generated Emails Listing Related Data In The Body

From Dwayne Wright PMP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit or other formatting of the posting may fail. For the best experience, please visit the journal directly by clicking (here).

A READER WRITES
I hope you don’t mind me troubling you this way. I am a doctor trying to solve a filemaker problem on our clinical information system and came across your site during a google search. I am still at a loss how to do this:
 
I want to be able to email notes on patients to colleagues. The body of the email comes from the Patients file, and I want to be able to include the list of diagnoses related to the patient, which are in the Diagnoses file. The two are linked by patient_id in a one to many relationship.
 
When I create a Send Mail script and enter calculation  to include the body text and ALL the diagnoses, the resultant email only has the first portal record, not all of the rows.     Any ideas?

DWAYNE RESPONDS
The problem with e-mailing portal data is that it is spread out to 2 or more records. At the very minimum, we has the record in the primary file and the record in the child file. So what we need to do is combine all this information into a single field. Think of it as an assembly operation where you may need to combine a few scripts running in multiple files.

What I would recommend is a combination of concantenated data from the diagnosis table (most likely with a calculation field like you are using) and then gathering those fields together using the LIST function.

THE LIST FUNCTION
The list function will provide you a return-delimited data list from a related data field or a repeating field. For the most part, this function is used for gathering related data in one large block and then using it for correspondence. For example, a list of related invoices in which you want to include in a batch email to each client in a found set. It is also possible that you would use the list function to pull a collection of related data as a list and then parse it out by using some of the value related text functions.

© 2010 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. FileMaker Pro is the registered trademark of FileMaker Inc.