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 / Help with week selector
Power Apps
Unanswered

Help with week selector

(0) ShareShare
ReportReport
Posted on by 108

I have created a travel/timesheet app and they have to select the week they are travelling or doing a timesheet for

 

michalison_0-1643902487501.png

The week should be 31/01/2022 until 06/02/2022 but they are all out of sync and selecting from the middle of the week

 

I have used this formula    

michalison_1-1643902599585.png

this must be wrong I am teaching myself powerapps so not sure what it should be.  Can anyone help  Thanks

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @michalison 

    You'll need to provide some details on the weeksList in your formula as it depends on that.

    Also, is this formula being used on the Items property of your dropdown?

  • michalison Profile Picture
    108 on at

    michalison_0-1643903948836.png

    Yes it is on the items

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @michalison 

    Change that formula to:

    Set(currentUser, User());
    Set(weeksList,
     With({_startDate: DateAdd(Today(), Weekday(Today(), MondayZero) * -1, Days)},
     ForAll(Sequence(20, 0), 
     With({_weekStart: DateAdd(_startDate, 7 * Value, Days)},
     {StartDate: _weekStart,
     EndDate: DateAdd(_weekStart, 6, Days)
     }
     )
     )
     )
    ) 
     

    (There is no need for the concurrent function - it will yield nothing to this formula)

     

    Change your Dropdown Items property to:

    ForAll(weeksList,
     {Value: Text(StartDate, ShortDate) & " to " & Text(EndDate, ShortDate)}
    )
    

     

    This should give you what you are looking for.

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard