The Workflows team holds weekly community office hours where you can ask questions about your flows, ask about potential uses cases, and share what you are working on.
I am a starting a new series where I will be sharing questions and answers from the office hours as they are valuable how-to’s.
So here is the first questions.
How to send a notification to a group of people based on a department?
You are onboarding an employee and based on their department you want to send an email to a group of people associated with that department. It can be one group or multiple groups. For example, if the person is in the Engineering department an email should go to that person plus a copy to firstname.lastname@example.org and email@example.com. And if the person is in the Marketing department, an email will go to that person plus a copy to firstname.lastname@example.org
A flow to do that is below:
The flow uses a table to hold department emails and looks like this:
This is how the flow works:
- The first card On Demand – Helper Flow makes this a helper flow. The helper flow has two inputs
Primary email. A helper flow can be reused with other flows
- The second card Tables – Search Rows retrieves all emails associated with the particular department
- The result from Tables – Search Rows is a JSON object with five key/value pairs. The List – Pluck card removes (plucks) all key/value pair except the one specified in the key input (
- The last card Gmail – Send Email sends an email to the person who was onboarded (
Primary email) and one or more department groups are copied (CC input) on the email
Have a question about Workflows? Not sure how to build a flow? Join the weekly community office hours to get help.