cancel
Showing results for
Did you mean:

## Problem with a date control

Hi,

I'm having some problem with my date check/control in my flow and it worked before I split up my form into 3 different sections (branching).

Now it gives me false positive.

I need it do check if the dates entered aren't entered wrong (e.x in the past or the ToDate greater than the FromDate).

I have a from i Froms that have 4 dates values:

• FromDateA - rde93b0d1e48845e29df431fcb653120a
• ToDateA - r65eff20ea9fc4e1fb5d03af1ae2195d5
• FromDateB - r8b6a7de6dad24e628d24a678ee4b6f92
• ToDateB - rf1410ece5b40432caaa1b68dfd7fcb80

And here is my Flow:

And here is the false positive:

Any idés?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi again @v-bacao-msft and @ManishJain!

I found the problem.

I don't know how it worked before and I must have been blind and got a brain freeze 😅

I had the wrong "check" in the Condition. It should (of course) be "Less or equal to".

Corrent: "FromDate is less than or equal to ToDate"

Wrong: "FromDate is greater than or equal to ToDate"

Thank you both!

8 REPLIES 8
Solution Sage

Hi Zowie,

Is it right that you are comparing string dates and not actual dates from the second screenshot . I think you should visit this link if it helps you:

https://powerusers.microsoft.com/t5/Building-Flows/Compare-dates/td-p/54802

Thanks

Hi @ManishJain,

I'm not sure that I understand you reply and the link correctly 😅 but the dates from From isn't a string? So I need to convert the date to a string?

It worked before when I only had one FromDate and ToDate. But not now when I have two of them

Solution Sage

Hi @ZowieS ,

What I meant by that was if the data is in date format or string. In the second screenshot you provided the response was in string. So I thought of confirming. The link provided gives you option to convert your dates into correct format first and then compare. Please follow link till the end .

Thanks

Hi @ManishJain,

I think the Date is in a String fotmat from MS From base on my testing before I added two different FromDate and ToDate

Please see where I hover over one of the From value:

And if I remove one group it will work for that part of the form that is in the Condition.

Ex: If I remove the group that contain FromDateA and ToDateA.
Only the results from the form that uses FromDateB and ToDateB will get checked correctly.

Solution Sage

Hi @ZowieS ,

Please refer to this link as well , it also talks about using ticks

https://sharepains.com/2018/11/02/microsoft-flow-compare-dates-using-conditions-in-the-sharepoint-co...

Thanks

Community Support

Hi @ZowieS ,

For comparing the date and troubleshooting easily, please consider filling the date in Compose and configure the output of Compose in Condition to compare the date.

Best Regards,

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

Hi @v-bacao-msftand @ManishJain ,

Thank you both for your help with this! 👍❤️

I was just looking for that so thanks a lot!

Sadly it didn't work with "Compose".

This is the flow:

(Note: In the parentheses "()" contains the 3 last characters of the ID corresponding to FromDate and ToDate

And here is the result:

I want the Result in "Condition" (picture above) to be false.

I think the problem is in the Condition but I have tried different solutions but still got the wrong result.

Hi again @v-bacao-msft and @ManishJain!

I found the problem.

I don't know how it worked before and I must have been blind and got a brain freeze 😅

I had the wrong "check" in the Condition. It should (of course) be "Less or equal to".

Corrent: "FromDate is less than or equal to ToDate"

Wrong: "FromDate is greater than or equal to ToDate"

Thank you both!

Announcements

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Our team will be reviewing posts using the new "Copilot" label to ensure we highlight and amplify the most relevant and recent content, so you're assured of high-quality content every time you visit. If you share a post that gets featured in the curated gallery, you'll get a PM in the Community to let you know!The curated gallery is ready for you to experience now, so visit the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community. We can't wait to see what you "cook" up!