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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Lookup email ID in a c...
Power Automate
Unanswered

Lookup email ID in a column in a Excel Table

(0) ShareShare
ReportReport
Posted on by 64

Hello

 

I'd like some help on how finish off a Flow I've started, please. I'm currently getting a list of emails that are sent from a certain email address:

email.png

 

That all works fine, but I'd like to lookup the Message ID of these emails in an Excel Table (Stored in OneDrive - table contains columns titled: SentDate, EmailID, Subject, Body Preview, To). If the message ID is there, then nothing happens, but if the message ID isn't present in the excel sheet, to add the relevant information in.

 

I can't quite get it to work. I only seem to be able to add all the emails in again, or get caught in a loop where it's adding every email, for every row.

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @Socrates 

    Hi there!  So, it sounds like you're trying to sync your emails (in a sense) with a spreadsheet, right?  The reason (I'm guessing) you get all the emails added in again is because as a condition checks each of the emails against your list, it will add it in if it doesn't find a match, right?

    For example, if I have 10 emails in my inbox (wishful thinking) and the first 9 are already in the spreadsheet, it will look at email #1 in my inbox and compare that to row one in my spreadsheet...not a match?  Add a row.  Row two...not a match? add a row.

     

    And so on.

     

    There are a couple of ways around this:

    • Change your trigger so that the Flow is triggered when a new email comes in, it adds it to the spreadsheet.  Then you won't have to check for duplicates.
    • Create a variable at the beginning, and then inside your Apply to Each loop (for matching against the Spreadsheet), update the variable with the email data, but only write it to the spreadsheet if you finish the loop without a match.

    There are a few ways to get this done, but here's another thread of someone trying something similar.

     

    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.

  • Socrates Profile Picture
    64 on at

    Thanks @edgonzales that link did help. Having the variable as the true/false was the biggest breakthrough for me.

    For anyone that may stumble on this in the future, my flow ended up looking like this. The first 'apply to each' I had to use the values from the email rather than the lookup table.

    screenshot.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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard