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 / How to check if an ema...
Power Automate
Unanswered

How to check if an email exists in a variable?

(0) ShareShare
ReportReport
Posted on by 312

Hello,

I'm trying the get the latest record from each user made in the past 12 hours.

 

The List rows works because I get all the records made in the past 12 hours. 

 

How do save into the variable only the latest ones from each user based on email address? My condition at the moment does not work, because all the List rows records end up in the variable regardless there being duplicate email addresses.

 

What am I doing wrong?

 

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Below is likely how I would build the flow.

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1699530906112.png

     

    List rows is what you currently have.

    grantjenkins_1-1699530929704.png

     

    Select extracts out your email addresses. For this example, I've just use the Created By (Value) field.

    grantjenkins_3-1699530999146.png

     

    Initiate variable is the same as what you have.

    grantjenkins_4-1699531026796.png

     

    Apply to each uses the following expression to iterate over each of the unique users.

    union(body('Select'), body('Select'))

    grantjenkins_5-1699531091211.png

     

    Filter array filters out the records where the user is equal to the current user we are iterating over.

    grantjenkins_8-1699531377160.png

     

    Append to array variable appends the first record returned to our array. It uses the following expression.

    first(body('Filter_array'))

    grantjenkins_7-1699531194890.png

  • ramzez Profile Picture
    312 on at

    It worked, thank you!

  • CU22101546-0 Profile Picture
    4 on at
     If you want to check if an email exists in a variable, you can take a pretty simple approach. First, you can validate the email format using a regular expression (regex) to ensure it looks like a valid email address. But if you're trying to find out if the email exists (like if it’s real and not fake), that’s a bit trickier.

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