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 / Efficient user friendl...
Power Apps
Answered

Efficient user friendly way to select multiple dates and add to collection?

(0) ShareShare
ReportReport
Posted on by 718

I am trying to use datepicker to allow users to add dates to a collection so that I can then run a ForAll based on that collection of dates. I am trying to find the easiest way for users to add multiple dates. They may be selecting work weeks at a time. Right now they have to select one at a time. Seems like there has to be a better way to do it? Any ideas?

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    HI @BrianHFASPS ,

    Do you want to select multiple dates once time within the DatePicker control?

     

    If you want to select multiple dates once time within the DatePicker control, I afraid that there is no way to achieve your needs in PowerApps currently.

    If you would like this feature to be added within PowerApps, please submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

     

    As an alternative solution, I think two DatePicker controls could achieve your needs. You could consider take a try to add two DatePicker controls within your app, then select a Date value within the first DatePicker control as Start Date, select another Date vlaue within the second DatePicker control as End Date.

    After that, you could calculate the Dates between the Start Date and End Date within your app, and add them into a Collection.

    I have made a test on my side, please take a try with the following workaround:1.JPG

     

    2.JPG

     

    3.JPG

    Set the OnSelect property of the "Calculate" button to following:

    ClearCollect(
     DateRanges,
     AddColumns(
     FirstN(
     [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],
     DateDiff(DatePicker1.SelectedDate, DatePicker2.SelectedDate, Days) + 1
     ),
     "Day",
     "Day " & (Value + 1),
     "Date",
     DateAdd(DatePicker1.SelectedDate, Value, Days)
     )
    )

    Set the Items property of the Data Table control to following (enable proper fields within your Data Table😞

    DateRanges

    Please check the attached GIF screenshot for more details:Test.gif

    Please also check and see if the response within the following thread would help in your scenario:

    https://powerusers.microsoft.com/t5/General-Discussion/Consecutive-date-range-into-collection/td-p/46764

     

    Best regards,

  • MohamedRiaz Profile Picture
    4 on at

    Dear Kris Dai,

     

    Thank you for your help in providing the above solution. I am now using this in my application, but I want to take this further and display an additional column (Users Column in below screenshot) in the ClearCollect which will show a count of the number of instances that particular date in each row is appearing in a sharepoint list. I cant seem to figure out how to filter the sharepoint list based on the cell value for each date that is displayed. Can you please guide me on how to do this. Appreciate any help you can provide.

     

    MohamedRiaz_0-1619946840612.png

     

    Thanks

     

    Mohamed RIaz

  • MohamedRiaz Profile Picture
    4 on at

    Dear @v-xida-msft 

     

    With reference to my post below, just to update you that below is my clearcollect code and I would to replace Today()+1, in the Filter with the date in each row under the SelectedDate Column. I will really appreciate any help you can provide on this.

     

    ClearCollect(DateRanges,AddColumns(FirstN([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],DateDiff(dtFrom.SelectedDate,dtTo.SelectedDate,Days)+1),"Day","Day "&(Value+1),"SelectedDate",Text(DateAdd(dtFrom.SelectedDate,Value,Days),"[$-en-US]dd/mm/yyyy"),"Users",CountRows(Filter(ApprovedUsers,OfficeName=cboOffices.Selected.OfficeName,RequestedDate=Today()+1))))

     

    Thanks

     

    Mohamed

  • almapete21 Profile Picture
    87 on at

    Hi. Is there a way to patch those dates, along with other fields (single line texts, numbers, choices, etc)? Would love to hear from you since this is helpful to us who need multi selection in dates.

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard