Hello all,
I'm trying to modify the ShP Online form of list, where is a date and time column called "Day" as following:
I need to enable the selection of a date when filling out the form in a specific month (May 2023), with the option to select a date no more than 7 days ago (including the record day) and without the option/deny the option to select future date.
I imagine that if a date outside the range is selected, an error message will be displayed and the save button will simply not work/do nothing until the correct date is selected.
So far, I have something like sample below, but I lack knowledge, or I don't know how to correctly define OnNew/OnSelect/OnSave or OrEdit, either directly in the Date Picker or in the SharePointIntegration -> Action field, and I'm not quite sure whether my condition is about right.. (at the moment, it's directly in the Date Picker in the DataCardValue4 - OnChange field.
If(Month(DataCardValue4.SelectedDate) = 5 && DataCardValue4.SelectedDate >= DateAdd(Today(),-7) && DataCardValue4.SelectedDate > Today(), UpdateContext({varDate: DataCardValue4.SelectedDate}), Notify("It is possible to record only a trip that took place less than 7 days ago", NotificationType.Error))
Could you please suggest how to finish the condition, how the code should look like and how to decide whether to modify the DataCardValue or SharePointIntegration part?
I apologize for basics, I just started with PowerPlatform/PowerFX and avoided excel (Cloud Infra Administrator) so there is definitely space for improvement and sharpen the learing curve.
Thank you!


Report
All responses (
Answers (