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

how to compare Dates in microsoft flow

Hi,

 

i have a list of items, thier details are saved in an excel sheet in Documents in sharepoint.

 

what i want is that to compare the dates of each of the items in that excel sheet with the current date, if it matchs it will send email.

 

i built the flow but i have an issue that condition is always false becasue the date is read as value from excel not as date format. for example 2019-04-24  will be taken as 43579 which will fail the condition.

 

any help please ..

 

thanks,

Ibrahim 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: how to compare Dates in microsoft flow

Hi @Ibrahimkhalil ,

 

As @Brad_Groux  suggested, date column will be returned as plain integers instead of date and time format when working with Excel online (Business) and Excel Online (OneDrive) connectors.

 

However, you may try if the following workaround will work for you.

 

Before start the flow, format the date column to Text then input the date manually in the Excel file.

1.PNG

 

Then start the flow likes below. The function used in the condition is:

 

formatDateTime(items('Apply_to_each')?['Start'],'yyyy-MM-dd')

is equal to

utcNow('yyyy-MM-dd')

 

2.PNG

 

Best regards,

Mabe

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: how to compare Dates in microsoft flow

Both of the Excel Online (Business) and Excel Online (OneDrive) connectors will always return the date column as plain integers instead of the date/time format. The original Excel Connector could return the date and time, but that connector is now deprecated.

Due to the reduced functionality and strict limitations (especially file lockout times) of the Excel Online connectors, Flow experts tend to agree that you should avoid using the Excel Online connectors at all cost. Instead, you could create and/or update a SharePoint list via the Excel document, and then pull the date/time from the SharePoint list data.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Community Support
Community Support

Re: how to compare Dates in microsoft flow

Hi @Ibrahimkhalil ,

 

As @Brad_Groux  suggested, date column will be returned as plain integers instead of date and time format when working with Excel online (Business) and Excel Online (OneDrive) connectors.

 

However, you may try if the following workaround will work for you.

 

Before start the flow, format the date column to Text then input the date manually in the Excel file.

1.PNG

 

Then start the flow likes below. The function used in the condition is:

 

formatDateTime(items('Apply_to_each')?['Start'],'yyyy-MM-dd')

is equal to

utcNow('yyyy-MM-dd')

 

2.PNG

 

Best regards,

Mabe

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Microsoft
Microsoft

Re: how to compare Dates in microsoft flow

@v-yamao-msft, I have an array of dates from JSON in my flow, how would I compare the array of dates to a single date in string format?

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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
Users online (6,232)