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

How to run flow after 3 days from a date value?

Could someone explain how I can do a daily check of a SharePoint list and run a flow depending on a date entry.

 

I need the flow to check for records that have a null value in a column (record closed value) and then check it's related date column entry. If the date today is 3 days greater than that date, then fire the flow.

 

Many thanks

11 REPLIES 11
Highlighted
Dual Super User
Dual Super User

Re: How to run flow after 3 days from a date value?

Hi

1.- Recurrence trigger

2.- SP 'Get items' action block. I am assuming you are talking about a SP list and not a SP library

In order to filter the contents of the list, there are different techniques:

-An 'Apply to each' with a Condition action block inside, taking 'Get items' output as 'Apply to Each' input

-A 'Filter Array' action block, then an Apply to Each taking Filter Array output as 'Apply to Each' input

-Filter ODATA query in the Get Items action block, then an Apply to Each taking 'Get items' output as 'Apply to Each' input

 

ILet's assume we work with the filter expression, and we want to search items with Column A null and column B 3 days less than today. Assuming both are called 'ColumnA' and 'ColumnB', a possible approach is the following Filter Array expression:

 

@And(less(item()?['ColumnB'], addDays(utcnow(), -3)),not(equals(coalesce(item()?['ColumnA'],'null'),'null')))

 

IN the following screenshot you will see the secuence of actions after trigger Recurrence, please not I am not using 'Get items' but 'Get files (properties only)' and the expression shown in the screenshot is not the one you need, but the following steps should be the same for you

 

Flow_FilterSP.png

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper V
Helper V

Re: How to run flow after 3 days from a date value?

Attaches is my list structure.

 

If the status is blank and it is 3 days since the DateAdded date, then an email should be sent.

The check needs to be done daily.

 

approvedflow.PNG

 

Thanks

 

 

Highlighted
Dual Super User
Dual Super User

Re: How to run flow after 3 days from a date value?

Hi again

If you follow my suggestion, the expression for your SP List would probably be:

@And(less(item()?['DateAdded'], addDays(utcnow(), -3)),not(equals(coalesce(item()?['Status'],'null'),'null')))

 

 

I would first implement the flow including yourself as destination of the email ('Send an email v2' shall be placed inside the Apply To each'), if it works as you expected (i.e. the List Elements reported are the ones you want to filter) then replace your email address and add the real destination. I am assuming you want to send one email per List element matching your conditions

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper V
Helper V

Re: How to run flow after 3 days from a date value?

Hi

 

Finally got around to testing it.

 

With the filter array I got

 

@And(less(item()?['Date Received'],addDays(utcnow(), -3)),not(equals(coalesce(item()?['Status'],'null'),'null')))

 

InvalidTemplate. The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@And(less(item()?['Date Received'],addDays(utcnow(), -3)),not(equals(coalesce(item()?['Status'],'null'),'null')))' failed: 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

Highlighted
Dual Super User
Dual Super User

Re: How to run flow after 3 days from a date value?

Hi
You expression uses item()?['DateReceived']
But
From the screenshot you shared I thibk you should replace it and use
item()?['DateAdded']
Instead
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper V
Helper V

Re: How to run flow after 3 days from a date value?

Hi

 

Even with DateReceived or DateAdded I get the same error.

 

Please advise

 

Thanks

 

 

Highlighted
Dual Super User
Dual Super User

Re: How to run flow after 3 days from a date value?

Hi again
Can any element of your Sharepoint list have an empty DataAdded column value?
Because this is the error thrown in your flow
Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper V
Helper V

Re: How to run flow after 3 days from a date value?

Hi 

 

The date column has no blank values.

 

There are some in the status column though.

 

Thanks

 

 

Highlighted
Helper V
Helper V

Re: How to run flow after 3 days from a date value?

Please see attached for new actual structure of the list.

 

Many thanksSP Tests.PNG

Highlighted
Dual Super User
Dual Super User

Re: How to run flow after 3 days from a date value?

Hi
You are not using 'DateAdded' column anymore but 'Date Received'. And you are using a space between Date and Received.
That'sthe reason why both
item()?['DateReceived']
and
item()?['DateAdded']
return null

Since you used a space to define your column name, now you will need to figure out the internal name Sharepoint has assigned to it.

My guessing, if you created the column with the name 'Date Added' you should use
item()?['DateAdded0']
However if you created the column with a different name and then changed its internal name can be anything, the best way to identify it is by opening your last flow execution and inspect 'Get items' output

Happy Flowing!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper V
Helper V

Re: How to run flow after 3 days from a date value?

Hi

 

I deleted the DateAdded column and added a new Date Received column.

 

 

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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 (8,280)