Hello, I hope everybody here are fine.
Currently, I have a delivery date fields as follows:
The idea here is not to allow to select an old datetime and not less than 4 hours, for example, if the service is requested for today 12/10/2021 at 11 am, the time could not be 11:30 but >= to 4 hours (15:30), how to do this?
Thanks in advance for the assistance.
Solved! Go to Solution.
Hi @Emont
I made a working sample the same with the form and here is the user to force to select the correct date and time.
Hi @Emont
We can't force the Calendar not to select but we can validate when the user selected while saving. The below code gives true or false based on the date selection
DateDiff(
DateTimeValue(
StartDatePicker7.SelectedDate & " " & TimeValue(
Concatenate(
StartHourDropdown.Selected.Value,
":",
StartMinutesDropdown.Selected.Value
)
)
),
Now(),
Minutes
) < 240
Example
On from save we can validate the user input and allow them to save. Below code can be used on Save button click
If(DateDiff(
DateTimeValue(
StartDatePicker7.SelectedDate & " " & TimeValue(
Concatenate(
StartHourDropdown.Selected.Value,
":",
StartMinutesDropdown.Selected.Value
)
)
),
Now(),
Minutes
) < 240,
SubmitForm(EditForm),
Notify("Selected Date Can't be less than 4 hours"))
Hi @Emont
I made a working sample the same with the form and here is the user to force to select the correct date and time.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
180 | |
52 | |
41 | |
38 | |
28 |
User | Count |
---|---|
255 | |
81 | |
71 | |
68 | |
66 |