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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to compare two dat...
Power Apps
Answered

How to compare two date field values on click of submit button in PowerApp

(0) ShareShare
ReportReport
Posted on by

Hello All,

I would like to apply the validation on click of submit button and I need to compare the two date field values.

 

Can anyone help me with this?

 

Any help would be appreciated.

Thank you in advance.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    @Anonymous  Moved this thread from News Annoucements to General Forum @Anonymous 

  • Verified answer
    v-yuxima-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Could you please share more of your requirements?

    Do you want to compare the two data values when you click submit button?

    I think you can use datediff function to help you achieve that. I test as next:

    Data Source:

    20190514DateCompareDataSource.PNG

     

    App Test:

    Add one label control,and rename it as Label_Message.

    Icon1(Submit).OnSelect=If(DateDiff(DataCardValue5.SelectedDate, DataCardValue4.SelectedDate )>0,SubmitForm(Form1))

    Label_Message.Text="You input DateEnd<DateStart,please input again!"

    Label_Message.Visible=DateDiff(DataCardValue5.SelectedDate, DataCardValue4.SelectedDate )<0

    Label_Message.Color=Red

    20190514DateCompareAppTest.PNG

     

    Hope this could be helpful.

     

    Best Regards.

    Yumia

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks for posting in the community @Anonymous - can you review the above reply and update the thread if it was helpful? 

     

    Thank you,

     

    @Anonymous 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard