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

Problem with dates in Microsoft Flow and Excel

Hi everyone!

 

I am getting this error on a flow (i'll post the images first and then explain it):

 

ErrorError

 

It happens in this flow:

Screenshot (74).png

Screenshot (76).png

Screenshot (77).png

The objective of this flow is to shot a message when a date in a table is equal or greater than today.

As you can see the flow seems to make sense, the data matches, but the only problem is that it treats the excel serial date as a string. Is there a way to convert the dates of each row into an interger, so I could then do a "greater than or equal to"?

 

Any help would be appreciated!

Best regards,

Flávio Neto

1 ACCEPTED SOLUTION

Accepted Solutions

@flavioPBadmin  are you comparing time too? if not use one option date format-ISO in list row present in a table.

and then use utcnow('yyyy-MM-dd) in your compose for comparison. 

 

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

View solution in original post

7 REPLIES 7
Hardesh15
Super User
Super User

@flavioPBadmin  How do you know which one is string? Inside apply to each use one more compose and pass your excel date column. Pls share output.

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

 

flavioPBadmin
Helper I
Helper I

Hi @Hardesh15,

 

I am 99% sure that it is the excel date. I tried to do "int(items('Apply_to_each_3')?['Outcome Date'])" to convert but I get this error:

Screenshot (78).png

 

Is there a way of knowing for sure which one is a interger and which one is a string?

 

flavioPBadmin
Helper I
Helper I

I also tried

int(item()?['Outcome Date'])

 

with the same error.

@flavioPBadmin  are you comparing time too? if not use one option date format-ISO in list row present in a table.

and then use utcnow('yyyy-MM-dd) in your compose for comparison. 

 

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

flavioPBadmin
Helper I
Helper I

This might be a bit of topic, but I added a compose to get a more readable date and got this error:

 

InvalidTemplate. Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.
 
The compse expression is
formatDateTime(items('Apply_to_each_3')?['Outcome Date'],'dd-MM-yyyy')
 
Any ideas of what I might be doing wrong?

@flavioPBadmin  Pls check if there is blank column value in excel. 

 

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

That was not the problem, but nor worries, I've tried to go about another way.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,726)