Thursday, October 4, 2012

Filemaker List of Emails Separated by Commas in a Global Text Field

I am using FileMaker Pro 11 and it has basic email functions. The major problem with the email function in FileMaker is it lacks any accounting of when and if the email was sent. Also, after closing and opening Filemaker, you have to re-enter the SMTP server again. A real pain.

So the best way is to use your own email program. When I use FileMaker, I usually want to send an email to multiple clients from the found set of records. The format the email programs use is emails separated by a semicolons.

The following solution will create a list of emails in your found set of records, separated by semicolons and copy to your clipboard using a FileMaker script so that you just have to paste the emails from the clipboard into the BCC box of your email.



Create a new global text field by going to File>Manage>Database..., call it Email List, click on tab Storage and check the box Use Global Storage, click OK, OK

Create Script in Filemaker

Script Name: List Emails

Go to Record/Request/Page [First]
Clear [Select; YourFMDatabaseFile::Email List]
Loop
   Set Field [YourFMDatabaseFile::Email List & YourFMDatabaseFile::YourEmailField & "; "]
   Go to Record/Request/Page [Next; Exit after last]
End Loop
Copy [Select; YourFMDatabaseFile::Email List]

Save

Find the set of records you would like to email. Run the script List Emails (or create a button that runs the script). Open your email program, open a BCC, paste the emails from the clipboard. Done.



YourFMDatabaseFile = Your FileMaker database file name
Email List = The global text field that was created in these instructions
YourEmailField = The name of your text field in your database with the emails
List Emails = The script that was created in these instructions

Source: http://fmforums.com/forum/topic/35357-display-a-comma-separated-list/