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 / Creating a set Rota in...
Power Apps
Answered

Creating a set Rota in powerapp

(0) ShareShare
ReportReport
Posted on by 33

I have created a basis of holiday booking system for my team and the management to use. Currently the calendar populates with the data i have .

Which is stored in a SP List called Leave Requests , 

 

Each day shows how many people are off that day and once you click on the day its show who is off in another gallery.

 

My problem is i and the management would like to display the Rota on the calendar too. Its a 4 on 4 off 8 day cycle. I have tried to create a collection but keep getting behaviour issues. Also wish this rota to be created yearly in advance automatically . Looking  at the picture below first day in would 5th September

HiteshM_0-1695643144550.png

 

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

    I'm not exactly sure what you're trying to do with ROTA. Have a field in the the table that indicates if the day is part of the on or off, based on the 4 day on and 4 day off cycle? For example, Jan 1-4 should have a value of On, while Jan 5 - 8 should be Off, and then have this repeat?

     

    If so, try the following:

    AddColumns(CalendarList,"OnOff",If(Mod(DateDiff(Date(2023,01,01),DateField),8)<4,"On","Off"))

    If the on/off cycle doesn't start on 1/1, then of course adjust that date. If the calendar isn't just for the current year, that date can be from any year. It gets the number of days between the specified date and today, and uses MOD to do division and get the remainder, which effectively gets a number from 0 to 7 for each date. A value of < 4 is set to "On", 4-7 is set to "Off". 

     

    Or, perhaps I interpreted your question incorrectly.

  • HiteshM Profile Picture
    33 on at

    Thankyou for reply, the rota is for display purposes in the calendar. So visually individuals can see the days they are working and wether they need to book it off or not. 

    Don't really follow the logic above as i don't have list to create my calander. I used the in built template

  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    Ok, so, I'm still a little unclear on your requirement. You used the calendar template, as in, you created a new screen and used the calendar template there? You then customized the calendar to show a count of items in the leave requests list?

     

    You mentioned the 4 day on/off cycle. Is this the same for every user who uses the app? If the user is viewing the calendar for October, 2023, what should the system show for Oct 1st, and how should it make that determination?

  • HiteshM Profile Picture
    33 on at

    Yes correct. October 1st would be day three and for every user bar 3 or 4 

  • Verified answer
    Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    Ok, so you want "3" to display on Oct 1, and "4" to display on Oct 5, etc., until 8, and then cycle back to 1. 

     

    If you add a label to the cell of the gallery, you can set it to:

    Mod(DateDiff(Date(2019,12,31),DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)),8)+1

    The above will generate a value from 1 to 8, based on which cell of the calendar it is in. 

  • Verified answer
    HiteshM Profile Picture
    33 on at

    Thankyou that works. Just need to colour code for the days in. Probably conditional formating

  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    You're welcome. But, so you know, please mark the answer as the solution, not your own comment as the solution. Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard