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 / Data picker which pick...
Power Apps
Answered

Data picker which picks working day

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

Currently I'm trying to create a data picker which picks working day.

We have holiday table which contains similar table:

 

Non-working days
2021-01-02
2021-01-03
2021-02-10
2021-02-11

 

When user picks date for example: 2021-01-02 it should automatically rewrite it to 2021-01-04 since 2021-01-02 and 2021-01-03 is non-working day. Are there any examples how can I achieve it?

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I did a test for you:

    1\ Add a DatePicker control 'DatePicker1' and set its onchange property to:

    If(Weekday(DatePicker1.SelectedDate)=1,Set(VarDate,DateAdd(DatePicker1.SelectedDate,1,Days)),Weekday(DatePicker1.SelectedDate)=7,Set(VarDate,DateAdd(DatePicker1.SelectedDate,2,Days)),Set(VarDate,DatePicker1.SelectedDate));Reset(DatePicker1)

     

    2\ Set the DatePicker control's DefaultDate property to:

    VarDate

     

    3\ The result is as follows:

    AAA.gif

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think you misunderstood. We have a table lets call it colNonWorkingDays. Our Collection contains of non-working days as given example:

     

    colNonWorkingDays:

    Result
    2021-03-18
    2021-03-19
    2021-03-20

    We have datapicker.

    When user picks 2021-03-18 it should jump to 2021-03-21 instead of 2021-03-18.

    Now your given example only works with saturday and sunday instead it should work with collection.

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

    Hi @Anonymous ,

     

    I did a test for you.

    1\ This is my collection 'colNonWorkingDays'.

    v-xiaochen-msft_0-1616050803432.png

     

    2\ Add a datepicker control 'DatePicker2' and set its onchange property to:

    If(DatePicker2.SelectedDate in colNonWorkingDays.Result,Set(VarDate,DateAdd(DatePicker2.SelectedDate,1,Days));Reset(DatePicker2),Set(VarDate,DatePicker2.SelectedDate))

     

    3\ Set the datepicker control's DefaultDate property to:

    VarDate

     

    4\ The result is as follows:

    AAA.gif

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard