cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VikasNagaraj
Helper V
Helper V

Send email from excel if the date is more than 42 days.

Hi All, 

I am trying to create a flow to send emails to people in list from excel file, 

1. I want to the check the excel file everyday, see if there is anyone whose date is over 42 days send them a specific email.

2. There are 2 project type, project 1 and project 2. I want to add condition if the person is from project 1 and the date is over 42 days, send specific email and if the person is from project 2 and the date is over 42 days send specific email. 

 

I have only come till this part and dont know if i am doing this right or what to do next, the flow does not give me errors and suceeds everytime i test it, but there is no result please help me. Thank you.

 

formatDateTime(items('Apply_to_each_2')?['Date'],'yyyy-MM-dd')

addDays(items('Apply_to_each_2')?['Date'],42,'yyy-MM-dd')

 

VikasNagaraj_0-1659974183601.png

VikasNagaraj_2-1659974214061.png

 

VikasNagaraj_3-1659974233787.png

 

 

VikasNagaraj_2-1659971054923.png

 

@Pstork1 @Expiscornovus @abm @tom_riha 

2 ACCEPTED SOLUTIONS

Accepted Solutions
tom_riha
Super User
Super User

Hello @VikasNagaraj ,

you can filter the rows directly in the 'List rows...' action to return only rows with a date over 42 days

DateColumn eq '@{add(div(sub(ticks(utcNow()),ticks(formatDateTime('1899-12-30'))),864000000000),42)}'

it'll return only the valid rows, all that's left is to loop through the rows in 'Apply to each' and add a 'Condition' depending on the project.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

abm
Super User
Super User

Hi @VikasNagaraj 

 

@tom_riha  Had a screenshare session with Vikas. There are couple of things he need to change as part of this requirement. Thanks for your prompt response.

 

Following are the steps we did.

 

1. Use the filter array step to get date greater than 42 days

2. Again filter the records with project names (Project 1, Project 2)

3. Once the records are retrieved then find the unique email recipients. Here used union and join expressions.

4. When the email is sent the update the relevant records to send email 'Yes'

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

5 REPLIES 5
tom_riha
Super User
Super User

Hello @VikasNagaraj ,

you can filter the rows directly in the 'List rows...' action to return only rows with a date over 42 days

DateColumn eq '@{add(div(sub(ticks(utcNow()),ticks(formatDateTime('1899-12-30'))),864000000000),42)}'

it'll return only the valid rows, all that's left is to loop through the rows in 'Apply to each' and add a 'Condition' depending on the project.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
VikasNagaraj
Helper V
Helper V

@tom_riha 

Thank you for your response, I did try the expression proviced, it gave me a error when i copied and pasted it, but when i removed the @ and {} it was fine, dont know if i did that right. 

The flow came sucessfull but no output, the apply to each is grayed out when i checked the test result. 

VikasNagaraj_0-1660032179761.png

Is this the right condition i am applying ?

VikasNagaraj_1-1660032247965.png

 

Hello @VikasNagaraj ,

if you take the expression exactly as it is it'll search for rows with the date in 42 days from today. If you want to search for 42 days in the past instead use -42.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
abm
Super User
Super User

Hi @VikasNagaraj 

 

@tom_riha  Had a screenshare session with Vikas. There are couple of things he need to change as part of this requirement. Thanks for your prompt response.

 

Following are the steps we did.

 

1. Use the filter array step to get date greater than 42 days

2. Again filter the records with project names (Project 1, Project 2)

3. Once the records are retrieved then find the unique email recipients. Here used union and join expressions.

4. When the email is sent the update the relevant records to send email 'Yes'

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm Thank you very much for your time and help. 
@tom_riha thanks for your respose and formula.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,494)