Power Automate: Automating sending of emails based on date.

in #hive-169321last year

This is a problem that I was trying to solve using MS Power Automate.

I want to be automating my sending of emails based on date. Say, to wish someone on my Excel sheet Happy Birthday when its their birthday.

We could set up scheduled cloud flow that checks the column of data with the birthdate every day at 9 am.

Screenshot 2023-10-19 at 10.37.43 PM.png

This is how the flow generally looks, i.e., after the flow started from scheduled cloud trigger, it looks for the Excel file assigned. Then use Apply to each and get the value. Set up the condition and then trigger the Email if its true.

Screenshot 2023-10-19 at 10.44.27 PM.png

This is the part that took me the longest time. That is, figuring out how to set up the condition. After some work, I figured out that I can use contains to check if the Date contains a substring of today's date. The substring function below does the magic as my date string looks like this: 2023-10-19T00:00:00.000Z. I use the function to extract the 0 to 10 position of the text showing current's date based on utcNow(), which ends up with 2023-10-19.

Since 2023-10-19T00:00:00.000Z contains 2023-10-19. The YES route is taken, and the email is sent.

Screenshot 2023-10-19 at 10.36.37 PM.png

Hope this is helpful.

Sort:  

Congratulations @snippets! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You got more than 10 replies.
Your next target is to reach 50 replies.
You distributed more than 50 upvotes.
Your next target is to reach 100 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!