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

Use Filter Array to Filter due date column from Get Items that is overdue

Hi All, 

 

I am trying to build a reminder email with a HTML table with the records that are overdue for processing. I have filtered my get Items by the relevant choice from my SharePoint List (Status eq 'Logged') and then I want to use a Filter Array to check if Due Date has passed, but Im getting all sorts of errors, any help would be great! 

 

error details

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@lessOrEquals(formatDateTime(item('Due Date'), 'ddMMyyyy'), utcNow())' failed: 'The template language function 'item' must not have any parameters.'.

 

Filter ArrayFilter ArrayGetItemsGetItemsCreate HTML TableCreate HTML TableSelect FunctionSelect Function

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

 

lessOrEquals(formatDateTime(item()['Due Date'], 'ddMMyyyy'), utcNow())

This will fix your expression error, but I'd be surprised if the date comparison works with that date format you have. Would 'yyyy-MM-dd' not work better for a date stored in a SharePoint list?

Even better would be to use an oData query on the SharePoint Get Items action and then you would have no need of the filter as you'd only get records back that were overdue. 

 

View solution in original post

7 REPLIES 7
Paulie78
Super User
Super User

 

lessOrEquals(formatDateTime(item()['Due Date'], 'ddMMyyyy'), utcNow())

This will fix your expression error, but I'd be surprised if the date comparison works with that date format you have. Would 'yyyy-MM-dd' not work better for a date stored in a SharePoint list?

Even better would be to use an oData query on the SharePoint Get Items action and then you would have no need of the filter as you'd only get records back that were overdue. 

 

Thanks @Paulie78  apreciate you coming back so quick! 

i'm getting an error:

Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The 'inputs' of workflow run action 'Filter_array' of type 'Query' is not valid. Property 'where' must be a template language expression.'

 

error.JPG

Paulie78
Super User
Super User

You didn’t put the expression in the expression editor. You just put it in as plain text. 

Thanks @Paulie78 , I am pretty new to Odata and find it a little confusing. 

 

How would I add it to the Query?

 

Status eq 'Logged' and 'Due Date' and ????

Thanks again appreciate your help! 

Paulie78
Super User
Super User

Go with the filter query for now. I’m not near a computer so can’t reply. But will do tomorrow unless someone else steps in. 

Thanks @Paulie78 

@gmccourt1981 

Please refer below image to add your query

Achavan_0-1606212311739.png

Hope this helps

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,726)