web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add weekdays to galler...
Power Apps
Unanswered

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard