web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating New Contact R...
Power Automate
Unanswered

Creating New Contact Records from Incoming Email

(0) ShareShare
ReportReport
Posted on by

Hi

I'm new to the site and new to building flows.  What I have done so far is asked that for every email that arrives in my inbox (Outlook) that a contact record be created with the email address and the given name and it get stored in a "new contact" folder.  

 

What I am getting is multiples of the same address as many of the same people send emails throughout the day.  What I would like it to do, is compare the email address to all of the email addresses in my "new contact" file and if it is there, do nothing. If it is not there then create the contact record.

 

I would love to be able to pick up phone numbers, company names and addresses automatically, but will be satisfied if I can just get those two pieces of information.

 

If this problem has already been solved or there is a template for it please let me know.

 

Best Regards

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Creating New Contact Records from Incoming Email

    @karenfield 

    Hi there!  So, to get all of the information (company, phone, so on) you'll probably need a 3rd party app.  Contacts + (Formerly FullContact) is one of my favorites because you can sync across multiple accounts, it grabs signatures, and has a pretty cool business card scanner.

    Just getting the name and phone number is doable, but I don't know the expression to parse that out (especially since it isn't always uniformly presented).

    I sketched something out that begins with

    • when a new email arrives
    • initializes a string variable (we'll need that later)
    • Gets all of the contacts then uses a condition to look for an instance when the eMail address in Contacts matches the From on the email.
    • This kicks off an Apply to Each loop because it is looking at each contact one at a time.  Don't panic.
    • If it finds a match, update the variable to the email address of the From.  If it doesn't, it leaves the variable as Null.
    • Outside of the "Apply to Each", we'll look to see if there's anything in the variable.  If there's something in there, then the contact existed and there's no need to do anything.  If it's blank, we add the email address and name (That's the expression I don't know, so I put the email address in both fields).
    • The Phone Number is required and you might not have that, so I put a bunch of 9's.

    There was also this add-in for $15 USD that does the same thing.  Totally up to you.   

     

    Keep us posted.

    -Ed-

     

     

    If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Creating New Contact Records from Incoming Email

    Hi @karenfield ,

     

    Perhaps you could try to configure Flow by referring to the following method.

     

    • Divide contacts into members of the organization and members outside the organization.
    • Personal information of Members within organization can be obtained through Get user profile action, but members of outside organization seem to only be able to save email addresses.
    • When receiving the email, use email address to determine if the current sender is already in contact list.
    • Use length() function to determine if there is a matching contact, and if not, create a new one.
    • Use Get user profile action to obtain personal information and configure two branches. The right branch can only be executed when Get user profile action fails.

    Image reference:

    35.PNG36.PNG

    Hope it helps.

     

    Best Regards,

  • Rhofie Profile Picture
    8 on at
    Re: Creating New Contact Records from Incoming Email

    Hi Barry,

     

    Thank you for this proposed solution.  I am trying to do something similar to the OP, but I want to create a new contact when I send an email.  For this, I simply swapped out "From" to "To" and used my Sent Folder instead of Inbox, I did everything else the same as you suggested. 

     

    Your solution did work to create a new contact, however, it is creating multiple contact records for the same email address as I continue to test AND, it's creating records for internal contacts.  Any suggestions?

    Rhofie_1-1689842379015.png

     

    Rhofie_0-1689841466870.png

     

    Also, it shows "Flow run failed", even though it did what I wanted it to do (except for skipping existing and internal contacts).  Is that expected?

     

    Thanks so much for your help!

  • Rhofie Profile Picture
    8 on at
    Re: Creating New Contact Records from Incoming Email

    I changed the Filter array to "does not contain" and that solved all of the issues mentioned above; no longer creating duplicates and no longer creating a contact record for internal contacts, and no longer showing as failed runs. 

    Rhofie_2-1689842939118.png

     

    Thank you, @v-bacao-msft for your solution!  I hope my tweaks help someone else who's trying to create contacts from emails sent.

     

  • Rhofie Profile Picture
    8 on at
    Re: Creating New Contact Records from Incoming Email

    Unfortunately, this flow stopped working the day after I posted 😣.  It's showing successful runs, but it's not creating any new contacts (intenal/external/duplicates of existing - none at all). 

    This is what a "successful" run looks like:

    Rhofie_0-1690266211838.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard