cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ibrahimkhalil
Level: Powered On

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
Community Support Team
Community Support Team

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

2 REPLIES 2
Super User
Super User

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!

Community Support Team
Community Support Team

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,095)