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 / Time Recording App - W...
Power Apps
Answered

Time Recording App - Week Drop-down List

(0) ShareShare
ReportReport
Posted on by

Hi There,

 

I have the following code. The code highlighted in orange is supposed to return the Monday of the most current week (i.e. if today is 4/4, it should pull 3/29. It continues to return 4/1. 

 

Any help would be greatly appreciated. 

 

Code:

Concurrent(
Set(currentUser,User()),


Set(currentMonday,
DateAdd(
Today(),(Weekday(Today(),Monday)-1)*-1,Days)),

 

Set(
weeksList,ForAll(Sequence(20,Day(DateAdd(Today(),-1 * (Weekday(Today(),Monday) - 1),Days)) - 28,7),Date(Year(Today()),Month(Today()),Value))));

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

    Hi @Anonymous :

    I think this formula is fine, and it should work normally.

    Set(currentMonday,
    DateAdd(
    Today(),(Weekday(Today(),Monday)-1)*-1,Days))

    I suggest you check if there is a problem with the settings of the weekslist. I have already replied to your other thread on this issue.

    Dropdown List showing "Week of" 

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bofeng-msft - can you explain what you mean by checking the settings of the weekslist? I'm unsure where to check this. I'm still running into the same issue for this month, as my current code is now showing that June 3rd is a Monday (which actually is a Thursday). The code in my other post (https://powerusers.microsoft.com/t5/Building-Power-Apps/Dropdown-List-showing-quot-Week-of-quot/td-p/880860) doesn't work for me. Any help would be greatly appreciated! 

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    I've made a test but it worked well on my side:

    Button-OnSelect

    Concurrent(
     Set(
     currentUser,
     User()
     ),
     Set(
     currentMonday,
     DateAdd(
     Today(),-1 * (Weekday(Today(),Monday) - 1),Days)
     ),
     Set(
     weeksList,
     ForAll(
     Sequence(20,0,1),
     DateAdd(Today(),-1 * (Weekday(Today(),Monday) - 1)+Value*7-28,Days)
    
     ))
    );

    Combo box-Items

    AddColumns(
     weeksList,
     "WeekEnd",
     DateAdd(
     Value,
     6,
     Days
     ),
     "Week Display",
     Value & " to " & DateAdd(
     Value,
     6,
     Days
     )
    )

    2.gif

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    Thanks @v-bofeng-msft  - where I'm running into an issue is that my drop-down list should default to the current week (i.e. 5/31-6/6). The "-28" within the code should then show me the last four weeks in that drop-down (going as far back as 5/3-5/9). The purpose of this is to allow my colleagues to make an input if they forgot to enter their information. Based on your video above, I don't see that it's defaulting to the current week and showing the previous four weeks and the subsequent number of works (per the sequence function) after the current week...

     

    Very much appreciate all your help with this! 

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bofeng-msft - your Concurrent formula worked. The only change I had to make was adding a space after "value" and also changed 28 to 35 (to show the previous 5 weeks). I also toggled between the drop-down for "value", as I changed it from "value" back to "Week Display". Now all is working. Thanks again for all the help!

    Capture.PNG

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard