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

Top Solution Authors
Users online (3,094)