cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
drishm
Helper I
Helper I

Filter Array Problem

Hi,

 

I have a SharePoint list created with the following for contracts:

 

  • Title
  • Todays Date (column created with flow)
  • Start Date
  • Expiry Date
  • Days Left (calculated column of expiry date - todays date)

Flow layout is:

  • Recurrence
  • Get items
  • Apply to each
  • Send email notification

On my flow, I have a "Filter_Array" that should only send me an email message when the days left is less than 30 - that does not seem to be working - am not sure if I am missing something?

 

I have it like this "days left" is less than "adddays(utcnow('yyyy-MM-dd'),30)"

 

Do I need a condition action?

 

Thank you. 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @drishm 

 

Have a look on my video tutorial

 

https://www.youtube.com/watch?v=L4vpYLfwTRk&t=119s

 



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

14 REPLIES 14
abm
Super User
Super User

Hi @drishm 

 

Is your Days Left column is datetime?

 

Try the below format

 

formatDateTime(adddays(utcnow('yyyy-MM-dd'),30),'yyyy-MM-dd')


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 my days left column is a calculated column (expiry date - todays date)

And data type returned is "number"

drishm
Helper I
Helper I

@abm - not sure if this will help - not sure if I am missing a condition action?

 

drishm_0-1607344774742.png

 

abm
Super User
Super User

Hi @drishm 

 

The issue is addDays returns the date (yyyy-MM-dd). What you really looking for?

 

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

Hi @abm, I'm looking for the filter to filter out the SharePoint list and only send me an email with items that have less than 30 days until they expire. If more than 30 days, don't want to receive that email. The Days Left column shows that but I can't get that part right to only send me an email for less than 30 days. 

Hi @drishm 

 

Thanks for your reply so you need to compare against the expiry date using the below expression

 

formatDateTime(adddays(utcnow('yyyy-MM-dd'),30),'yyyy-MM-dd')



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

Hi @abm 

 

Please see below:

 

drishm_0-1607410919797.png

 

I cannot seem to get it right - all emails are still coming through and not only the ones less than 30 days - can you please assist?

 

Hi @drishm 

 

Could you try yyyy-MM-dd format?

 

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

Hi @abm - still the same problems with the emails. 

I have it set "expiry date" less than and then your expression you gave me. 

Hi

 

I just noticed that you have an apply to each loop in your screenshot. Could you please explain? Also a full screenshot of your flow is helpful.



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

Hi @abm - it's just a few thing I saw online to try and help me out - am open to suggestions as to how the flow should be:

drishm_0-1607425626541.png

drishm_1-1607425682282.png

drishm_2-1607425720367.png

drishm_3-1607425751375.png

 

 

drishm
Helper I
Helper I

My Sharepoint list looks like this

 

drishm_4-1607425872283.png

 

Hi @drishm 

 

Have a look on my video tutorial

 

https://www.youtube.com/watch?v=L4vpYLfwTRk&t=119s

 



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

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,232)