cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
janp
Regular Visitor

troubles filtering date after fetching rows from a table

I'm fetching a table from an excel file on my onedrive for business.

I want to filter the table on a date field (Column1) containing dates formatted like 2019-10-15T07:30:14.224Z, only keeping the records with the date set today.

In the filter array I've set this formula 

@equals(formatDateTime(item()?['Column1'],'yyyy/MM/dd'), utcnow('yyyy/MM/dd'))

 

But no output is generated.
When checking the result i get :

INPUT:
From
[
{
"@odata.etag": "",
"ItemInternalId": "0fEXGJmpaow",
"Column1": "2019-08-01T05:29:39.826Z",
"__PowerAppsId__": "0fEXGJmpaow"
},...

]

 

OUTPUT:
Body

  []

 

I could use some help with this

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

This is a common problem when working with dates.  The issue is that dates always include both a date and a time component.  But you are trying to just check whether the dates are equal, not the times.  To do that you need to filter out the date portion on boht sides of the equation.  Use the same FormatDateTime() function around UTCNow() that you use for Column 1.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
janp
Regular Visitor

screenshots of flow and result

2019-10-15 14_05_34-Run History _ Microsoft Flow.png

Pstork1
Dual Super User III
Dual Super User III

This is a common problem when working with dates.  The issue is that dates always include both a date and a time component.  But you are trying to just check whether the dates are equal, not the times.  To do that you need to filter out the date portion on boht sides of the equation.  Use the same FormatDateTime() function around UTCNow() that you use for Column 1.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

janp
Regular Visitor

Hi,

 

Unfortunately, when I use the formatdatetime function on the utcnow part, it returns an error.

2019-10-15 14_34_13-Edit your flow _ Microsoft Flow.png

Pstork1
Dual Super User III
Dual Super User III

You are missing a closing ')' parentheses on your formula.  You close out the FormatDateTime, but not the @equals.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
janp
Regular Visitor

Thanks for your help, it is working now, however only if the excel table contains less than 256 rows.

I believe I've read about that somewhere in another thread.

Pstork1
Dual Super User III
Dual Super User III

Take a look at the section covering Pagination in the following article.

 

https://flow.microsoft.com/en-us/blog/four-connector-action-settings/



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (21,140)