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 / Add weekdays to galler...
Power Apps
Answered

Add weekdays to gallery when user select datepicker.

(0) ShareShare
ReportReport
Posted on by 237

Hi Team,

I created Time sheet app,In that my requirement is when user select date from date picker and user onselect of button(Add days).

 Based on current date,remaining days dynamically added to the gallery.

 scenario like this

   User select date picker on monday  remaining 4 days to be added to the gallery .

If User select date picker on Thursday remaining 1 day to be added to the gallery .

Saturday and sunday not to be considered.

 How can achieve thisone,please help...!

Powerappsuser11_0-1690635978240.png

user select monday dates to be like below.

Powerappsuser11_1-1690636021994.png

user select middle of week dates to be like below

Powerappsuser11_2-1690636101882.png

 

 

 

Categories:
  • elseb Profile Picture
    774 Moderator on at

    Hi

     

    ForAll(
     Sequence(
     DateDiff(
     VarStartDate,
     VarEndOfTheWeek +1
     )
     ),
     VarStartDate - 1 + Value
     )

     

    replace varStartDate with the user selected date and

    varEndOfTheWeek with last day of the week (you can calculate it automatically)

     

    and it should populate the gallery with dates.

     

    Seb

  • Powerappsuser11 Profile Picture
    237 on at

    Hi @elseb 

     

    Using above code getting below error

    please help..!

    Powerappsuser11_0-1690704425782.png

     

  • elseb Profile Picture
    774 Moderator on at

    try this instead: 

    ForAll(Sequence(6 - Weekday(DatePicker6.SelectedDate)+1), DatePicker6.SelectedDate - 1 + Value)

     

    the nr 6 represents the end of the week in this case it's Friday, Saturday is 7 and restarts at 1 on Sunday.

     

     

    Seb

  • Powerappsuser11 Profile Picture
    237 on at

    Hi @elseb 

     

      Can you provide how can add rows to the gallery.

    Above code is written onselect of add days button. but I think create collection and give that collection to gallery.

    Plaese help

  • Verified answer
    elseb Profile Picture
    774 Moderator on at

    that goes into items of the gallery, if you want it in onSelect you can do clearcollect(colDays, HEREGOESTHECODE) and put items of the gallery as colDays

    Seb

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard