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

Flow Condition greater than submission date

Hello,

 

I have this flow, the user submits a Microsoft Form to trigger to order products. I am trying to setup a condition to prevent users from ordering dates that have already passed. I have been having problems with this condition stopping some dates that are in the future and allowing other dates through, it just doesn't seem consistent. 

 

Flow 1.png

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Flow Condition greater than submission date

Looking at your output my suspicsion is that you are doing a Text comparison rather than a date comparison.  Like you I would have thought the output of the conversion would be a DateTime string, but it looks like it might be producing a formatted text string instead.  That would throw off the comparison.  Let me play around with it a bit and see whether I can reproduce your issue.



-------------------------------------------------------------------------
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

8 REPLIES 8
Dual Super User
Dual Super User

Re: Flow Condition greater than submission date

Is there a specific reason why you are converting the submission time from UTC and the delivery time from Eastern?  I would look first to make sure that you aren't adding discrepencies based on using two different time zones for your calcuations.  Otherwise it looks about right.

 

For troubleshooting, have you checked the runs to see exactly what dates/times you are comparing?  That would be the first thing to check to make sure the data being compared isn't the problem rather than the comparison itself.



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

Re: Flow Condition greater than submission date

The submission time is auto generated by the Microsoft Form and seems to be in UTC, the task time is manually entered just as a date. I was using the convert time task to format the string. 

 

I have checked the outputs and they are always correct, but the condition returns this as false even though the task is past the submission date. 

 

Flow 2.png

 

But here you can see when they resubmit for a date that has already passed, the condition allows it through

 

Flow 3.png

Dual Super User
Dual Super User

Re: Flow Condition greater than submission date

Looking at your output my suspicsion is that you are doing a Text comparison rather than a date comparison.  Like you I would have thought the output of the conversion would be a DateTime string, but it looks like it might be producing a formatted text string instead.  That would throw off the comparison.  Let me play around with it a bit and see whether I can reproduce your issue.



-------------------------------------------------------------------------
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

Codymlvn
Level: Powered On

Re: Flow Condition greater than submission date

Are you thinking i might have to use an expression to format the output? I have seen other post reccomend comparing dates/time as ticks, but I am not familiar with using ticks.

 

Thanks for your help!

Dual Super User
Dual Super User

Re: Flow Condition greater than submission date

That may be the solution.  To use Ticks, just put your formatted Date/Time timespans inside the Ticks() function.  That will translate to actual numbers that can be compared more directly.  Other than that I haven't really been able to replicate your issue.  The other suggestion I would have would be to format your dates as full Date/Time strings so you can see what is being compared.



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

Re: Flow Condition greater than submission date

So formating the long date seems to fix for any future vs. past, but now it's an issue for the same day

 

Flow 4.pngLayoutFlow 6.pngTest short dateFlow 7.pngTest long date

Dual Super User
Dual Super User

Re: Flow Condition greater than submission date

As I mentioned originally.  YOu'll have to make sure you aren't throwing off the comparison because you are converting one from UTC to Eastern and the other from Eastern to Eastern.  If you used the same date/time for both you would still end up with a 4 hour difference based on the conversion.  That may be enough to mess up the test for same day.



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

Re: Flow Condition greater than submission date

I have removed the EST to EST convert and added a Compose action to format the DateTime, after testing on a recent one that failed it seems to be holding. I think the comparison was not comparing based on the format. Thank you for your help

Helpful resources

Announcements
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!

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 Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,302)