Automated mail digest of 3 random records

695 3
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I want to create an email digest that automatically sends an email with 3 randomly chosen records from one of my tables. The idea is that it randomly sends me 3 per week until it has cycled through all of them and then restarts (all records become eligible again). 

I messed around with email digest automation but was struggling with the part where you randomly select records and record when it has already been sent (thus making that record ineligible until all have been sent). Any ideas for how to accomplish this? 

3 Replies 3

If you want to pick random records, you will need some sort of scripting. 

One way is to go with a completely customized script that picks random random records, marks them as picked, and resets records when they are all picked. If you are familiar with scripting this would have fewer actions and could put all the logic in one place. 


A method that doesn’t require any JavaScript skills would be to use the Batch Update extension to fill all records with a random number. Create a view that is sorted on that random number and filtered to only show unsent records. Then do a “Find Records” action that picks up the records in that view, and use my Automations Helpers script that tells you the first records from a “Find Records” action. (The description says it gets you the first record, but it actually gives you the first three.) You may use the script multiple times: once for each field that you want to include, and again for the record IDs so that you can update them to a sent status. (You would need three update record actions, one per record.)

This is great - thank you so much. THis workflow makes sense to me conceptually. 

Pardon my ignorance - where can I find the scripting capability in my automation? I may be blind, but I'm not seeing it. Also, as I am new to scripting but think I can eventually solve this personal project, would you be able to direct me to any similar examples of scripts? 

Thank you!

where can I find the scripting capability in my automation

If you have a Pro plan or higher, add a scripting action. If you are on a Free or Plus plan, you cannot use automation scripts.