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 / Allow user to submit f...
Power Apps
Answered

Allow user to submit form if parameters are meet

(0) ShareShare
ReportReport
Posted on by 31

Hello 

 

I've got a form with a Start and End Date on it. What I want to do is to have a save button that only allows the user to save the form if the current dates are changed to a another range of dates. I know I'd need some sort of If statement in before the Submit(Form1), but I'm unsure how to do this. Any ideas what code I could use to implement this? 

Categories:
  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @southafrican 

    The answer from Carlos in this post describes how you can implement this type of validation.

    https://powerusers.microsoft.com/t5/General-Discussion/Start-and-end-date-validation/m-p/52863

    The answer in this post disables the submit button if the conditions are not met.

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @southafrican ,

    Do you want to verify date whether in a range of dates before submit form?

    If so, firstly I suggest you use two date pickers to choose date.

    And then set this formula to the save button's OnSelect:

    If(DatePicker1.SelectedDate>date1&&
    DatePicker1.SelectedDate<date2&&
    DatePicker2.SelectedDate>date3&&
    DatePicker2.SelectedDate<date4,SubmitForm(Form1)
    )

    Only if the date that you selecte in datepicker1 in range from date1 to date2 and the date that you selecte in datepicker2 in range from date3 to date4, the form will be submitted.

    Please replace date1,date2,date3,date4 with the dates that you wan to limit, note that you could only replace with date value.

     

    Best regards,

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard