Posts

Showing posts with the label Weekends

PowerApps Formulae - Exclude weekend formulae

While working on PowerApps I had a requirement from client to exclude the weekends and if user select the weekend throw an error and set the date selected to Friday if user select the date is Saturday or Sunday. By default we don't have option in PowerApps to achieve this functionality. But using the formulas below we can achieve this. Update following code on "OnChange" property of the Date picker.  Weekday(         Self.SelectedDate,         StartOfWeek.Monday     ) > 5,     Notify(         "You are not allowed to select Weekend. Please Select Date Monday - Friday",         NotificationType.Error     ); The formulae above will verify the selected day is Weekday or not. if it is not weekday, it will throw error. In the second part, we will set the Friday value if user choose Saturday or Sunday.   Set(         varUpdatedDate,      ...