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.

email script won't skip empty fields

Featured Replies

Hi,

I'm glad that FM7 now includes bcc emailing, which means that I can now use it to email our students without making their email addresses public.

The only problem is that not all students have given us their email addresses, and I've found that if there are some blank email address fields the send mail script won't work.

Is there some way of getting the script to ignore the blank fields?

Thanks

in your script add an If Statement around the email sending section of the script to see if the email address is not empty. If it is it will not try to send the email and will go to the next record

Go To Record Request [First]

Loop

If Not IsEmpty (your email address field)

## Perform your send mail here

End If

Go To Record [next, exit after last]

End Loop

This assumes you are looping through the found set of records

  • Author

Thanks for that - it worked great.

(Anyone who is trying this looping method, remember to make sure that the checkbox in the specify send mail script to send the email to all found set is not checked otherwise it won't work if there is a blank record or it wil send multiple emails to everyone in the set.

How could I do this without the looping, if I just wanted to send one standard email to the found set, but still ignore the blank fields?

One way would be to create a list of the email addresses in a global field with the correct seperator between each address (obviously dependant on your email app)

To do this you would need a global text field (lets call it gHoldEmails) and also to create a layout with just the email address on.

Then in your script;

Go To Layout [Email address only]

Copy all records

Go To Layout [a layout with the gHoldEmails global field on it]

Paste [select entire contents tableref::gHoldEmails]

Set Field [ Substitute (tableref::gHoldEmails; ["

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.