Best answer

Script - Count and separate emails that are from a specific domain

  • 15 July 2020
  • 2 replies
  • 87 views

I’m using Zapier to pull calendar events from my team’s cal, crosscheck attendee emails with our CRM, and send a survey to our team members who were on the cal invite so they can provide feedback on the meeting that  is fed back into the CRM.

 

I’m wondering if there’s a way to execute the following two functions using code on Zapier, or if something like the Formatter might help me accomplish this.

 

I want to input the list of emails e.g. bob@myco.com, jane@externalcompany.com, tom@externalcompany.com, susan@myco.com, hermione@myco.com

 

and receive two outputs:
myAttendees: the emails of all the people on the list from my domain (myco.com) e.g. bob@myco.com, susan@myco.com, hermione@myco.com

qty: the quantity of my team members on the list. e.g. 3

 

Is this possible? Thank you in advance for any ideas!!! I’m wishing right about now that I had gotten into python when I had the chance…

icon

Best answer by ForYourIT 15 July 2020, 22:56

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +7

Hi @basil and welcome!

To answer shortly, yes this is definitely possible. For 1 you can use a regex to check if the input array matches the regex. For 2 you can just count the items in the array that passed the first section.

Have you tried something already? If so, where are you stuck?

let me know if you need more assistance. Maybe i will write you something later when I got some time. 

~Bjorn

Hi @ForYourIT ,

 

thanks for the offer to help and the welcome! Here’s what I’ve got so far, but I keep getting an error from Zapier.

 

def find_email(input_data)
    email_values = input_data.value
    if email_values.contains(“@myco.com”)
        return email_values
    end