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 / i have start date and ...
Power Apps
Unanswered

i have start date and end date column in power apps if start and end date is nearby saturday and sunday then i only able to select one particular value from choice column.

(0) ShareShare
ReportReport
Posted on by

I am using this formula but it's not works. if anyone have any idea about this then please feel free to share.
Formula I used in Power Apps in onselect : -

Patch(
 
   Defaults('Leave DB'),  // Replace with your actual data source 
   { 
      'Leave Type': If( 
                        !(Weekday(DateValue(DataCardValue18.SelectedDate)) = 1 || Weekday(DateValue (DataCardValue18.SelectedDate)) = 7) &&
                        !(Weekday(DateValue(DataCardValue12.SelectedDate)) = 1 || Weekday(DateValue(DataCardValue12.SelectedDate)) = 7),
                        DataCardValue13.SelectedItems , // Allow any choice when not near Saturday or Sunday
                        If(
      (Weekday(DateValue(DataCardValue18.SelectedDate)) = 6 And Weekday(DateValue(DataCardValue12.SelectedDate)) = 2) Or
    (Weekday(DateValue(DataCardValue18.SelectedDate)) = 2 And Weekday(DateValue(DataCardValue12.SelectedDate)) = 2) Or
  (Weekday(DateValue(DataCardValue18.SelectedDate)) = 6 And Weekday(DateValue(DataCardValue12.SelectedDate)) = 6) Or
  (Weekday(DateValue(DataCardValue18.SelectedDate)) = 2) Or
    (Weekday(DateValue(DataCardValue12.SelectedDate)) = 6) Or
  (Weekday(DateValue(DataCardValue18.SelectedDate)) = 6) Or
    (Weekday(DateValue(DataCardValue12.SelectedDate)) = 2),
    "EL" ,  // Restrict to "EL" when the start date is Friday and end date is Monday
    Notify("Please select a different value because the start and end dates are not near Friday and Monday.")
            )
                    ), 
 
      Start: DataCardValue18.SelectedDate,  // Replace with your actual start date picker name 
      End: DataCardValue12.SelectedDate, // Replace with your actual end date picker name 
      'Name (field_0)': Label2.Text,
      Reason: Value(DataCardValue17.Text),
      'No. of Days': Value(DataCardValue16.Text)
   }

 

my UI :

Ashishneo_0-1706166832057.png

@powerapps

 

Categories:
I have the same question (0)

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard