cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Recurring Email from Excel Data based on a condition

I am hoping for some guidance on feasibility and approach for the following flow:

 

1) Every Saturday, read a table via "Excel Online" with following fields: Date 1, Date 2, Name 1, Name 2

2) If Date 1 = Today's date, Create an email using Date 2 (deadline) in the body, and send to Name 1 and cc: Name 2.

3) If today's date has no matches in the Date 1 column, email to admin@123.com

 

Thank you,

Yash

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

Please refer to screenshot below to create the flow:

1.png2.png3.png

 

The fist expression in the Condition for the Date1's date:

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date1']),-2)),'yyyy-MM-dd')

The second expression in the Condition for today's date:

formatDateTime(utcNow(), 'yyyy-MM-dd')

The expression for the Date2 in the email body:

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date2']),-2)),'yyyy-MM-dd')

  

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

13 REPLIES 13
Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

Please refer to screenshot below to create the flow:

1.png2.png3.png

 

The fist expression in the Condition for the Date1's date:

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date1']),-2)),'yyyy-MM-dd')

The second expression in the Condition for today's date:

formatDateTime(utcNow(), 'yyyy-MM-dd')

The expression for the Date2 in the email body:

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date2']),-2)),'yyyy-MM-dd')

  

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

Thank you so much Alice!

I will try this and accept as solution in next day or so. 

Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

Waiting for your feed back.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

Hi @v-alzhan-msft  Alice, 

 

Thank you for your input. I setup my flow today but it failed at the date comparison step, see below:

 

 
 

 

Could you explain what these date expressions are doing? I tried replacing date 1 expression in the condition with the field value "date 1", and it is able to go through without error but match is not accurate, ie: condition 2 is executed and no parameters in the condition 1 are met even though multiple should be.

 

Thank you for your help!

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

Error ScreenError Screen

Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

Please make sure that the date column in your excel table has been converted to date type without time.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

Hi Alice @v-alzhan-msft , 

 

I updated the formatting and there was no time in there. Let me know if I am missing something here:

 

Capture4.PNG

Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

Please share all the expressions in your flow.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

Capture99.PNGCapture991.PNGCapture992.PNG

Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

You shouldn't use my expression directly, please update the date column name in my expression with yourselves:

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date From']),-2)),'yyyy-MM-dd')

 

formatDateTime(addDays('1900-01-01',add(int(items('Apply_to_each')?['Date to']),-2)),'yyyy-MM-dd')

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

🙊I am sorry, I totally missed that.

 

I updated the expressions and it works. However, for Date 2, I get the following output:

 

 

Capture993.PNG

 

 

How do I change the date format to April 3, 2020?

 

Thank you so much for all your help!

Highlighted
Community Support
Community Support

Re: Recurring Email from Excel Data based on a condition

Hi @yash5 ,

 

Take a try to formate it as screenshot below:

 

1.png

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Recurring Email from Excel Data based on a condition

Thank you so much for your help through this. I would love to learn more about expressions and dynamic content. 

 

Also, for the outlook add-in, do you think it would be possible for flow to look-up emails in the address book based on name?

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,377)