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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send e-mail only to us...
Power Automate
Unanswered

Send e-mail only to user that match date conditional requirements

(0) ShareShare
ReportReport
Posted on by 24

screencapture-emea-flow-microsoft-manage-environments-Default-a8bcda6a-e5fc-468e-b14a-af6ebf303051-flows-d2f9fba8-7dae-4cfb-8d10-ba9b3ad02ca3-2021-02-03-20_39_38.pngHello, I would need a little help with the flow process.  I have a Sharepoint list with two columns. Column 'Name' contains a user names. Column 'Date' contains dates. I have used formatDateTime function to compare the current date with the dates from column 'Date' If it match, then based on the username I am getting user e-mail address and the e-mail is sent to that user. And all that works. The problem is that the e-mail is sent to all users from the list, even if the date next to their names is not matching current date I would like that e-mail to be sent only to these users, who have current date next to their names. How to accomplish that?

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @cnapan ,

     

    How do you get the current date and how do you format the date on the SharePoint list? Would you please share the expressions for the formatDate functions?

  • cnapan Profile Picture
    24 on at

    Hi @Anonymous 

    That is the formula I am using:

     

     

    formatDateTime(triggerBody()?['Last_x0020_day_x0020_at_x0020_wo'], 'dd-MM-yyyy') is equal to formatDateTime(utcNow(),'dd-MM-yyyy')

     

     

  • VictorIvanidze Profile Picture
    13,081 on at

    Why do you do "Search for Users"? For what?

  • cnapan Profile Picture
    24 on at

    Because I got only user name in Sharepoint column in shape like this: "Joe Doe". I need to obtain somehow the user e-mail address, based on his name.

    Does the question is related somehow to my issue?

  • VictorIvanidze Profile Picture
    13,081 on at

    Sorry, my bad, I thought you have the address in the list.

    Could you somehow test "if no" branch?

  • cnapan Profile Picture
    24 on at

    Not sure how to test.  I think I am missing some step that takes only the values that matches condition before the sent-email step.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @cnapan ,

    What I would suggest for testing is, 

    1) Initialize 2  string variables. The current date variable will have the expression formatDateTime(utcNow(),'dd-MM-yyyy')

    soysalf_0-1612437542996.png

     

    2) When you have the SharePoint item set the relevant date. The expression will be formatDateTime(triggerBody()?['Last_x0020_day_x0020_at_x0020_wo'], 'dd-MM-yyyy')

    soysalf_1-1612437652245.png

    3) for the condition compare the two variables.

    when you run your flow you should able to see what is assigned for each variable. Please send those screenshots so we can see the result of the expression

    soysalf_2-1612437812170.png

     

     

     

  • cnapan Profile Picture
    24 on at

     Hi @Anonymous 

    I have tested it and now it gives me an error on the formula getting date from sharepoint. I did not changed anything, but now it cannot get the date properly. It worked yesterday. Eh... Instead go forward with that issue I am only getting back. 😞Capture.PNG

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @cnapan ,

     

    In my example, I didn't give an initial value for the SharePoint date. 

    soysalf_0-1612449424356.png

     

     

  • cnapan Profile Picture
    24 on at

    Hi @Anonymous 

    Have done what you have asked for.. Not sure what that is proof though,

    screen.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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard