web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Condition in DataCardV...
Power Apps
Answered

Condition in DataCardValue

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have two date fields that are dependent.

 

I need to create a condition in which DataCardvalue2 can only be filled if the value is greater than or equal to DataCardvalue1.

Categories:
I have the same question (0)
  • Verified answer
    eka24 Profile Picture
    20,925 on at

    What you need to do if to give notification to the user like:

     

    If(DataCardvalue1.SelectedDate>

    DataCardvalue2.SelectedDate, Notify "StartDate should be equal or less Then EndDate")

     

    Or you can highlight the date, so in the fill of the date;

    If(DataCardvalue1.SelectedDate>

    DataCardvalue2.SelectedDate,Red,White)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    it worked, Thank you!

    But, another doubt, can I prevent the person from being able to save the form if the field is filled in wrong?

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    You can put the question in a new post. But explain further what you meant by "if the field is filled in wrong?" Give example

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    For example : If I fill in DataCardValue2 with a date value less than DataCardValue1, I get the notification that the date value must be greater than or equal to DataCardValue1, but I can save the form in the same way, even if the date value is incorrect.

     

    And I would not like it to be saved with the wrong date value, but rather that it would not allow saving.

  • eka24 Profile Picture
    20,925 on at

    On the Onselect of the save button, you can use the same formula

    If(DataCardvalue1.SelectedDate>

    DataCardvalue2.SelectedDate, Notify ("StartDate should be equal or less Then EndDate"),SubmitForm(YourformName)

     

    Replace SubmitForm(YourformName) with Patch formula if using patch

     

    Thus if the criteria if not met, the form will not be saved.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have a problem now, because the dates do not need to be filled in to be submitted, they just need to be filled in correctly, but if the field is empty, I should submit it.

    Ah any possibility of submitting these dates if the field is empty?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard