cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AuburnMist
Resolver I
Resolver I

Repeating array of specific numbers for employee schedules

Hi folks, 

I have a really tough challenge here for someone!

I have little experience with creating math-based formulas in PowerApps. My objective calls for some math functions and I'm hoping someone here may be able to provide me some code.

I am trying to achieve a way for managers and team leaders to input their employees' schedules for a full year (365 days). I resolved how to achieve this when the schedule is fixed at 37.5 hours per week (Mon-Fri, 7.5 hrs/day, 5 days/week)

What I need next is to develop a way for them to input a custom schedule, which repeats either every 7 days, 14 days, 21 days or 28 days. 

Each of the cycles (7, 14, 21 or 28), must repeat over and over to fill 365 days.

For example:

Employee A may have a schedule in a 7-day cycle like this: 

 

Mon

Apr 4

8 hours

Tue

Apr 5

8 hours

Wed

Apr 6

8 hours

Thu

Apr 7

8 hours

Fri

Apr 8

5.5 hours

Sat

Apr 9

0 hours

Sun

Apr 10

0 hours

Total = 37.5 hrs/wk or 150 hrs/mth

 

Employee B may have a schedule in a 14-day cycle like this: 

 

Mon

Apr 4

8.5 hours

Tue

Apr 5

8.5 hours

Wed

Apr 6

8.5 hours

Thu

Apr 7

8 hours

Fri

Apr 8

8 hours

Sat

Apr 9

0 hours

Sun

Apr 10

0 hours

Mon

Apr 11

0 hours

Tue

Apr 12

8.5 hours

Wed

Apr 13

8.5 hours

Thu

Apr 14

8.5 hours

Fri

Apr 15

8 hours

Sat

Apr 16

0 hours

Sun

Apr 17

0 hours

Total = 75 hrs/biweekly or 150 hrs/mth

 

What I need is a text box where the manager or team leader can input the number of days in the schedule (7, 14, 21, or 28)

 

AuburnMist_0-1651760607366.png

 

 Plus, another text box where they can input the starting date of the schedule

 

AuburnMist_1-1651760607367.png

 

If the selection is a 7-day schedule, they need to then get 7 rows of data to input. If the selection is 14 days, they need to get 14 rows of data to input, etc. (always starting on a Monday).

Once they have entered the schedule in the appropriate number of days (cycle), then that cycle needs to automatically repeat for the remainder of the fiscal year (ends Mar 31).

I would like to use a gallery to achieve this – possibly by some type of sequence as in my regular Mon-Fri solution:

 

AuburnMist_2-1651760607372.png

 

The Items property of my gallery is: ForAll(Sequence(365, 0), DateAdd(Date(2022,04,01), ThisRecord.Value, Days))

It has no individual controls to set cycles or hours of work.

 

To build a custom schedule, the user needs these controls and the gallery needs to reflect the cycle of hours against the appropriate dates.

I guess the first solution that is required is to find a code that will take this array and repeat it over and over from the start date selected to March 31st.

Example: 8, 8, 8, 8, 5.5, 0 ,0, (then repeat over and over as: 8, 8, 8, 8, 5.5, 0, 0)

 

Hoping someone knows how to write a code that will take a series of numbers and repeat them over and over. 

 

Fingers crossed that someone can help! 

 

Thanks a bunch! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AuburnMist 

Okay...so I reconsidered your design to be more flexible.

After a good night of sleep - Here is how it goes:

 

App primary controls:

Dropdown for Fiscal Year - ddYear

Dropdown for Employee - ddPerson

Dropdown for Cycle - ddCycle

Gallery for Customization of Pattern - galPattern

Gallery for Schedule - galSchedule

Icon for clearing customizations - icnUndo

Icon for Saving Schedule - icnSave

Icon for removing fiscal year records - icnRemove

Html Text control for displaying calculation of total hours in customization pattern - htmlTotals

 

Properties:

ddYear

Items property: 

ForAll(Sequence(3, Year(Today())), {Value: Value, Holidays: Filter('Statutory Holidays', FiscalYear=Value)})

DisplayMode property: 

If(icnUndo.DisplayMode=Edit, Disabled,  DisplayMode.Edit)

 

ddPerson

Items property (obviously this part needs more):

["Angele", "Randy"]

 DisplayMode property:

If(icnUndo.DisplayMode=Edit, Disabled,  DisplayMode.Edit)

 

ddCycle

Items property:

Table(
    {Value: "Standard Week", Pattern: Table({Day: [1, 2, 3, 4, 5], Hours: 7.5}), Weeks: 1},
    {Value: "7 Day Cycle", Pattern: Table({Day: [1, 2, 3, 4], Hours: 8}, {Day: [5], Hours: 5.5}), Weeks: 1},
    {Value: "14 Day Cycle", Pattern: Table({Day: [1, 2, 3, 9, 10, 11], Hours:8.5}, {Day: [4, 5, 12], Hours:8}), Weeks: 2},
    {Value: "21 Day Cycle", Pattern: Table({Day: [3], Hours:8.5}, {Day: [1, 2, 4, 5, 8, 9, 10, 11, 12, 15, 16, 17, 18], Hours:8}), Weeks: 3},
    {Value: "28 Day Cycle", Pattern: Table({Day: [1, 2, 3, 9, 10, 11, 15, 16, 17, 22, 23, 24], Hours:8.5}, {Day: [4, 5, 12, 18, 25, 27], Hours:8}), Weeks: 4}
) 
/*
    
Table(
    {Value: 5, Pattern: Table({Day: [1, 2, 3, 4, 5], Hours: 7.5})},
    {Value: 7, Pattern: Table({Day: [1, 2, 3, 4], Hours: 8}, {Day: [5], Hours: 5.5})},
    {Value: 14, Pattern: Table({Day: [1, 2, 3, 9, 10, 11], Hours:8.5}, {Day: [4, 5, 12], Hours:8}, {Day: [7], Hours:0})}
)*/

DisplayMode property:

If(LookUp(Schedules, Title=ddPerson.Selected.Value && Year=ddYear.Selected.Value, true) || (icnUndo.DisplayMode=Edit), Disabled,  DisplayMode.Edit)

 

galPattern

Items property:

With({_days: Calendar.WeekdaysLong()},
    ForAll(Sequence(ddCycle.Selected.Weeks * 7),
        With({_dayNumber: Mod(Value, 7)},
            {Week: RoundUp(Value/7, 0),
            DayName: Index(_days, _dayNumber + 1).Value,
            Day: If(_dayNumber=0, 7, _dayNumber),
            PatternSequence: Value,
            Hours: Coalesce(LookUp(ddCycle.Selected.Pattern, Value in Day, Hours), 0)
            }
        )
    )
)

DisplayMode property:

If(ddCycle.DisplayMode = Disabled && icnUndo.DisplayMode=Disabled, Disabled, Edit)

TemplateFill property:

Switch(Mod(ThisItem.Week, ddCycle.Selected.Weeks),
    1, LightSteelBlue,
    2, LightGray,
    3, LightCyan,
    0, LightGoldenRodYellow,
     RGBA(0, 0, 0, 0)
)

 

Two controls in the galPattern template - Label for day of week - lblPatDay, TextInput control for entry of customization - txtPatHours

 

lblPatDay Text Property: 

ThisItem.DayName

txtPatHours Default Property:

Coalesce(LookUp(ddCycle.Selected.Pattern, ThisItem.PatternSequence in Day, Hours), "0")

txtPatHours Reset property:

lclReset

 

galSchedule

Items property:

With({_fiscalYear: Value(ddYear.Selected.Value), _fiscalStartMonth: 4},
    With({_items: Filter(Schedules, Year=_fiscalYear, Title=ddPerson.Selected.Value)},

        ForAll(Sequence(DateDiff(Date(_fiscalYear, 1, 1), Date(_fiscalYear+1, 1, 1)), 0),
            With({_date: DateAdd(Date(_fiscalYear, _fiscalStartMonth, 1), Value)},
                {Date: _date,
                 _Item: LookUp(_items, Date=_date),
                 _Week: Mod(WeekNum(_date, StartOfWeek.Monday) - WeekNum(Date(ddYear.Selected.Value, _fiscalStartMonth, 1), StartOfWeek.Monday), ddCycle.Selected.Weeks) + 1,
                 _Holiday: LookUp(ddYear.Selected.Holidays, Date=_date, Title),
                 _weekDay: Weekday(_date, StartOfWeek.Monday)
                }
            )
        )
    )
)

TemplateFill property:

Switch(Mod(ThisItem._Week, ddCycle.Selected.Weeks),
    1, LightSteelBlue,
    2, LightGray,
    3, LightCyan,
    0, LightGoldenRodYellow,
     RGBA(0, 0, 0, 0)
)

 

Four controls in galSchedule gallery template:

    Label for Date - lblDate

    Label for Day Type - lblDayType

    Text Input for hours changes - txtHours

    Rectangle icon control - to separate weeks - rctSep

 

lblDate Text Property:

Text(ThisItem.Date, "mmmm dd, yyyy  dddd")

lblDate Color Property:

If(ThisItem._weekDay in [6, 7], Blue, RGBA(0, 0, 0, 1))

 

lblDaytype Text Property:

Coalesce(
    ThisItem._Holiday,
    If(IfError(Value(txtHours.Text), 0) =0, "Day of Rest", "Work Day")
)

lblDayType FontWeight Property:

If(!IsBlank(ThisItem._Holiday), Bold, FontWeight.Normal)

txtHours Default Property:

Coalesce(
    ThisItem._Item.Hours,

    If(!IsBlank(ThisItem._Holiday), 0),
    LookUp(galPattern.AllItems, Week = ThisItem._Week && Day = ThisItem._weekDay, txtPatHours.Text)
 
)

rctSep Y property: 

Parent.TemplateHeight - Self.Height

rctSep Height Property:

1

rctSep Visible Property:

ThisItem._weekDay=7

 

icnUndo

OnSelect Action:

UpdateContext({lclReset:true}); UpdateContext({lclReset:false})

DisplayMode property:

If(CountRows(Filter(galPattern.AllItems, !(Value(txtPatHours.Text) = Hours)))>0, DisplayMode.Edit, Disabled)

 

icnSave

OnSelect Action:

Patch(Schedules,
    ForAll(Filter(galSchedule.AllItems, !(IfError(Value(txtHours.Text), 0) = _Item.Hours)),    
        {ID: _Item.ID,
         Title: ddPerson.Selected.Value,
         Date: Date,
         Year: Value(ddYear.Selected.Value),
         Day: Text(Date, "dddd"),
         Hours: Value(txtHours.Text),
         DayType: lblDayType.Text
        }
    )
)

 

icnRemove

OnSelect Action:

Remove(Schedules, Filter(Schedules, Year=Value(ddYear.Selected.Value) && Title=ddPerson.Selected.Value).ID)

DisplayMode Property:

If(ddCycle.DisplayMode=Edit, Disabled, Edit)

 

htmlTotals

HtmlText Property:

With({_weeks: GroupBy(galPattern.AllItems, "Week", "_days")},
    Concat(_weeks, "Week " & Week & ": <b>" & Sum(_days, Value(txtPatHours.Text)) & "</b> hrs<br>") & 
    "<hr>Total:<b> " & Sum(galPattern.AllItems, Value(txtPatHours.Text)) & "</b> hrs"
)

 

The look as I put it together for you (design as you see fit):

RandyHayes_0-1651846791777.png

 

 

All of this does what you were looking for.

The user can select the fiscal year and person.  If the schedule for that person already exists, then it is displayed in the scheulde gallery and can be customized or removed (via trash icon).  Once changes are made, user can save updates.

If the schedule does not exist, then the user can select the cycle.  Each cycle has a "default" pattern to it.  That pattern is then shown in the pattern gallery.  The user can then alter the pattern while monitoring the totals in the totals area.  The schedule will update itself based on that pattern as they make the changes.  Once complete, the schedule can be further altered and saved, or just saved.

 

From the design standpoint - it is quite basic and just galleries of rows.  Ultimately I would have preferred a more "calendar-like" view of everything, but that is a future enhancement if you wish.

 

SO...lots of pieces to put together above, but put them in your app and see how things go.  I think that I covered all the properties, but if something doesn't work quite right, just let me know.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

27 REPLIES 27
RandyHayes
Super User
Super User

@AuburnMist 

Yes, this is quite simple to do, but before mentioning how, I have a couple of questions:

1) If you are generating values for a whole year (and don't assume 365 days as you could be dealing with a leap year), then why would the user enter a starting date?

2) Do you really want the user to enter a number for the cycle?  What if they enter 5 as the cycle instead of 7 or 14, etc.?  I would suggest a dropdown instead, but want to know if that is an option or there is some other purpose for the text entry.

3) Is there any editing or manipulation of the hours for the days expected in your gallery, or is it just for display?  And if just for a display, do you really need to display it or can you skip the display and just go to data?

 

Let me know and I can provide an answer for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi Randy, so glad it's you! You have helped me before tremendously and I enjoy your YouTube videos! 

You asked some great questions. 

1) If you are generating values for a whole year (and don't assume 365 days as you could be dealing with a leap year), then why would the user enter a starting date?

A) I never thought about leap years! I guess what I need are the daily schedules between the start of our fiscal and  the end of our fiscal (April 1 - March 31 annually). This could be 365 or 366. Hmm..how do I make a sequence between two days then as opposed to by number of days per year? The user may have to enter a starting date if the employee requests a custom schedule sometime during the fiscal year as opposed to right at the start of the fiscal year. They are allowed to request one at any time and the manager or team leader would need to modify it from the approval date onwards all the way to end of fiscal. 

2) Do you really want the user to enter a number for the cycle?  What if they enter 5 as the cycle instead of 7 or 14, etc.?  I would suggest a dropdown instead, but want to know if that is an option or there is some other purpose for the text entry.

A) We need to use 7 days as opposed to 5 because if the employee works overtime on a weekend, the team leader would enter the number of overtime hours worked (for ex: 4 hours on Saturday), and these 4 hours need to add to the employee's total hours for the cycle, manipulating the employee's production expectations upwards. The purpose of this whole schedule app is to feed into a production app. So I need to ensure there is a way to capture additional hours worked on any day of the week (and also, they will deduct hours for absences etc.) resulting in accurate production expectations based on total hours worked. A dropdown would be absolutely (and better even) then a text box. Good observation! 

3) Is there any editing or manipulation of the hours for the days expected in your gallery, or is it just for display?  And if just for a display, do you really need to display it or can you skip the display and just go to data?

A) There is no real need to display the employee's schedule for 365/366 days in a gallery. I just liked to provide a visual of the schedule after it was built to instill confidence in the user that they input it correctly. 

RandyHayes
Super User
Super User

@AuburnMist 

Glad to help out and lucky to be on the forum and see your post today.

 

So in regard to point #1 - don't worry about the leap year at this point, I already have that worked out for you.  

However, this statement - "The user may have to enter a starting date if the employee requests a custom schedule sometime during the fiscal year as opposed to right at the start of the fiscal year. " has some concerns:

1) You are implying an "edit" sort of ability for a specific period of the fiscal year...however, your concept is based on an entire year entry system, not s specific period.  In other words, you are generating a pattern to apply for the year - so how would the above statement relate to a specific period?  It would seem to me that what you are creating is a way to generate a year worth of records with hours values.  It would then make sense to me that you have an alternate method for modifying a portion of the schedule (or the schedule in general).  Ideally, you could do this by making the entire gallery editable, but this would depend some on how you are storing this information to determine the mechanism you need for that - but, quite possible to do.

 

For Point #2 - yes...go with a dropdown control.  This will save you a lot of grief!

 

For Point #3 - This really relates to what I just mentioned above in Point #1...you seem to imply in #1 an editing capability, but I am not getting a clear picture on that from you yet.  If the concept I mentioned above is applied (the ability to create (initially based on a pattern) AND edit the year schedule (based on random changes)) then the Gallery (or a more calendar-like display) would be just fine for this.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Oh boy, now I'm starting to rethink this whole solution. YES, I definitely need a way to allow the schedule the be modified at any time during the year. The idea of using a sequence/pattern likely isn't going to work because one cannot edit a hard coded pattern, I assume.

I have been wracking my brain for a month on this, reading everything I can online, and watching a ton of videos and cannot find the best way to approach this. When I discovered the sequence function, I thought "there, that will get me on the right track", but alas, now I'm thinking I may have been incorrect. 

I'm totally stumped. 

I am trying to avoid the user having to input a separate entry for each day of the year (that would be preposterous!) The data must go into a SharePoint list in individual records in order for the complimenting solutions (leave/overtime app, and the PowerBI report) to be able to utilize the number of hours each and every day to calculate productive and non-productive hours and finally, performance results. 

Without the scheduled-hours-per-day piece, nothing can be achieved. 

Do you have a fantastic idea how I can make this happen!? (I bet you do!) 😉

RandyHayes
Super User
Super User

@AuburnMist 

Of course! 🙂  I was kind of "baking" that into my last response...

As I see it, your app would create a schedule for a person.  This would generate a table (gallery) that would be editable.  Initially, if there are no records for the selected person recorded in your list, then it simply creates the records based on the pattern and/or any changes made.  When saved, new records are created.

If the person already has records for the year chosen, then the user would see the records in the gallery (just like when creating) and can modify at that point as needed.  When saved records are updated.

 

Does that sound like a valid approach? 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes, this sounds fantastic!

I wonder if its possible for me to have ONE solution in the app that could create the regular Mon-Fri schedule, OR any custom schedules. 

I have a good solution for the regular Mon-Fri schedule. 

I have this code on a button; 

With({stagingTable: ForAll(Sequence(365) As mySequence, {
    Title: "Angele", 
    Date: DateAdd(DateValue("2022,03,31"), mySequence.Value, Days), 
    Day: Text(DateAdd(DateValue("2022,03,31"), mySequence.Value, Days), "dddd"), 
    Hours: If(
              Weekday(DateAdd(DateValue("2022,03,31"), mySequence.Value, Days))=1 || 
              Weekday(DateAdd(DateValue("2022,03,31"), mySequence.Value, Days))=7, 0, 
              If(
                 Weekday(DateAdd(DateValue("2022,03,31"), mySequence.Value, Days))=6,7.5,7.5)), 
    DayType: If(
              Weekday(DateAdd(DateValue("2022,03,31"), mySequence.Value, Days))=1 || 
              Weekday(DateAdd(DateValue("2022,03,31"), mySequence.Value, Days))=7, "Day of Rest", 
              "WorkDay")
    })
}, 
Patch(Schedules,stagingTable)
)

With just the push of this button, a full year's schedule populates my SharePoint list. 

 

AuburnMist_0-1651767707814.png

 

 Is there a way to integrate the solution you are envisioning (whatever that might be as I don't know yet lol), to work together with the above? I'm afraid that if an employee has a regular schedule entered, and then wants to change it to a custom schedule, that it will send new records to this list IN ADDITION to their previous Mon-Fri schedule. 

RandyHayes
Super User
Super User

@AuburnMist 

Well, that formula is a little easier to handle, and it can all be incorporated into the other pattern based.

 

So the remaining question then is, is the Title what ties the person to the records?  And, I assume you want this to function for any year besides just 2022 as it is hard-written into your formulas!?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Yes, this one was easy(ish) because the pattern doesn't change. The Title is the employee's name who's schedule this belongs to. I will have a means for the user to indicate the person, and the code will be updated because currently it is hard-coded with my first name (not what I need, but I know that). Same with the year; I will have a dropdown where the user can select the appropriate fiscal year start (2022,03,31, or 2023,03,31 etc.)

Still a work in progress! 

🙂 

RandyHayes
Super User
Super User

@AuburnMist 

So here is the approach that seems to fit what you are looking for:

 

NOTE: for the below, there is one additional column needed for your SharePoint list - a numeric column called Year which will represent the fiscal year.

 

In the app:

3 dropdowns - one for the fiscal year, one for the person and one for the pattern.  (I will call them ddYear, ddPerson, ddPattern)

1 Gallery - to display a year worth of schedule for the fiscal year that will also allow editing of the hours per day. (I will call it galSchedule)

1 Save icon - to save all changes. (I will call it icnSave)

1 Trash Icon - to remove an entire schedule for the year selected (I will call it icnRemove)

 

For ddYear -

    Items property of Sequence(3, Year(Today()))  This will provide three years to choose from, adjust as needed.

 

For ddPerson -

    Items property of (Since we have not discussed logic for the person selection, it is just hard-written as) ["Angele", "Randy"]

 

For ddPattern -

    Items property of:

Table(
    {Value: 5, Pattern: Table({Day: [1, 2, 3, 4, 5], Hours: 7.5})},
    {Value: 7, Pattern: Table({Day: [1, 2, 3, 4], Hours: 8}, {Day: [5], Hours: 5.5})},
    {Value: 14, Pattern: Table({Day: [1, 2, 3, 9, 10, 11], Hours:8.5}, {Day: [4, 5, 12], Hours:8})}
)

    (NOTE: This only includes the patterns for 5, 7 and 14 day cycles...additional can be added)

    DisplayMode property of: 

If(LookUp(Schedules, Title=ddPerson.Selected.Value && Year=ddYear.Selected.Value, true), Disabled,  DisplayMode.Edit)

 

For galSchedule - 

    Items property of: 

With({_fiscalYear: Value(ddYear.Selected.Value), _fiscalStartMonth: 4},
    With({_items: Filter(Schedules, Year=_fiscalYear, Title=ddPerson.Selected.Value)},

        ForAll(Sequence(DateDiff(Date(_fiscalYear, 1, 1), Date(_fiscalYear+1, 1, 1)), 0),
            With({_date: DateAdd(Date(_fiscalYear, _fiscalStartMonth, 1), Value)},
                {Date: _date,
                 _Item: LookUp(_items, Date=_date)
                }
            )
        )
    )
)

 

The template of the Gallery contains 3 controls:  A label called lblDate, a label called lblDayType and a Textinput control called txtHours

The Text property of lblDate is: Text(ThisItem.Date, "mmmm dd, yyyy dddd")

The Text property of lblDayType is: If(IfError(Value(txtHours.Text), 0) =0, "Day of Rest", "Work Day")

The Default property of the txtHours controls is:

Coalesce(
    ThisItem._Item.Hours,

    With({_pattern: ddPattern.Selected.Pattern},
        Coalesce(LookUp(_pattern, Weekday(ThisItem.Date, StartOfWeek.MondayZero) + 1 in Day, Hours), 0)
    )
)

 

For icnSave - 

    OnSelect action of: 

Patch(Schedules,
    ForAll(Filter(Gallery3.AllItems, !(IfError(Value(txtHours.Text), 0) = _Item.Hours)),    
        {ID: _Item.ID,
         Title: ddPerson.Selected.Value,
         Date: Date,
         Year: Value(ddYear.Selected.Value),
         Day: Text(Date, "dddd"),
         Hours: Value(txtHours.Text),
         DayType: lblDayType.Text
        }
    )
)

 

For icnRemove -

    OnSelect action of:

Remove(Schedules, Filter(Schedules, Year=Value(ddYear.Selected.Value) && Title=ddPerson.Selected.Value).ID)

     DisplayMode property of:

If(ddPattern.DisplayMode=Edit, Disabled, Edit)

 

Putting it to work...

The app will allow you to select the fiscal year and the person.  The gallery will show all dates for the fiscal year (accounts for leap years too).

If there is no schedule recorded for that person for the fiscal year, then the pattern dropdown will be enabled and the user can select the pattern of hours to apply.  If there IS a schedule for the person for the fiscal year, then the gallery will be displaying what has been recorded previously (including any edits).

 

The user can edit any day and any hour amount if needed.

 

When the user hits save, the records are created if not existing already, or updated if already existing.

 

RandyHayes_0-1651772239491.png

 

RandyHayes_1-1651772303132.png

 

 

See how that works for you!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA

Tuesday Tip: Subscriptions & Notifications

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week: All About Subscriptions & Notifications We don't want you to a miss a thing in the Community! The best way to make sure you know what's going on in the News & Announcements, to blogs you follow, or forums and galleries you're interested in is to subscribe! These subscriptions ensure you receive automated messages about the most recent posts and replies. Even better, there are multiple ways you can subscribe to content and boards in the community! (Please note: if you have created an AAD (Azure Active Directory) account you won't be able to receive e-mail notifications.)   Subscribing to a Category  When you're looking at the entire category, select from the Options drop down and choose Subscribe.     You can then choose to Subscribe to all of the boards or select only the boards you want to receive notifications. When you're satisfied with your choices, click Save.   Subscribing to a Topic You can also subscribe to a single topic by clicking Subscribe from the Options drop down menu, while you are viewing the topic or in the General board overview, respectively.     Subscribing to a Label Find the labels at the bottom left of a post.From a particular post with a label, click on the label to filter by that label. This opens a window containing a list of posts with the label you have selected. Click Subscribe.           Note: You can only subscribe to a label at the board level. If you subscribe to a label named 'Copilot' at board #1, it will not automatically subscribe you to an identically named label at board #2. You will have to subscribe twice, once at each board.   Bookmarks Just like you can subscribe to topics and categories, you can also bookmark topics and boards from the same menus! Simply go to the Topic Options drop down menu to bookmark a topic or the Options drop down to bookmark a board. The difference between subscribing and bookmarking is that subscriptions provide you with notifications, whereas bookmarks provide you a static way of easily accessing your favorite boards from the My subscriptions area.   Managing & Viewing Your Subscriptions & Bookmarks To manage your subscriptions, click on your avatar and select My subscriptions from the drop-down menu.     From the Subscriptions & Notifications tab, you can manage your subscriptions, including your e-mail subscription options, your bookmarks, your notification settings, and your email notification format.     You can see a list of all your subscriptions and bookmarks and choose which ones to delete, either individually or in bulk, by checking multiple boxes.     A Note on Following Friends on Mobile Adding someone as a friend or selecting Follow in the mobile view does not allow you to subscribe to their activity feed. You will merely be able to see your friends’ biography, other personal information, or online status, and send messages more quickly by choosing who to send the message to from a list, as opposed to having to search by username.

Monthly Community User Group Update | April 2024

The monthly Community User Group Update is your resource for discovering User Group meetings and events happening around the world (and virtually), welcoming new User Groups to our Community, and more! Our amazing Community User Groups are an important part of the Power Platform Community, with more than 700 Community User Groups worldwide, we know they're a great way to engage personally, while giving our members a place to learn and grow together.   This month, we welcome 3 new User Groups in India, Wales, and Germany, and feature 8 User Group Events across Power Platform and Dynamics 365. Find out more below. New Power Platform User Groups   Power Platform Innovators (India) About: Our aim is to foster a collaborative environment where we can share upcoming Power Platform events, best practices, and valuable content related to Power Platform. Whether you’re a seasoned expert or a newcomer looking to learn, this group is for you. Let’s empower each other to achieve more with Power Platform. Join us in shaping the future of digital transformation!   Power Platform User Group (Wales) About: A Power Platform User Group in Wales (predominantly based in Cardiff but will look to hold sessions around Wales) to establish a community to share learnings and experience in all parts of the platform.   Power Platform User Group (Hannover) About: This group is for anyone who works with the services of Microsoft Power Platform or wants to learn more about it and no-code/low-code. And, of course, Microsoft Copilot application in the Power Platform.   New Dynamics365 User Groups   Ellucian CRM Recruit UK (United Kingdom) About: A group for United Kingdom universities using Ellucian CRM Recruit to manage their admissions process, to share good practice and resolve issues.    Business Central Mexico (Mexico City) About:  A place to find documentation, learning resources, and events focused on user needs in Mexico. We meet to discuss and answer questions about the current features in the standard localization that Microsoft provides, and what you only find in third-party locations. In addition, we focus on what's planned for new standard versions, recent legislation requirements, and more. Let's work together to drive request votes for Microsoft for features that aren't currently found—but are indispensable.   Dynamics 365 F&O User Group (Dublin) About: The Dynamics 365 F&O User Group - Ireland Chapter meets up in person at least twice yearly in One Microsoft Place Dublin for users to have the opportunity to have conversations on mutual topics, find out what’s new and on the Dynamics 365 FinOps Product Roadmap, get insights from customer and partner experiences, and access to Microsoft subject matter expertise.  Upcoming Power Platform Events    PAK Time (Power Apps Kwentuhan) 2024 #6 (Phillipines, Online) This is a continuation session of Custom API. Sir Jun Miano will be sharing firsthand experience on setting up custom API and best practices. (April 6, 2024)       Power Apps: Creating business applications rapidly (Sydney) At this event, learn how to choose the right app on Power Platform, creating a business application in an hour, and tips for using Copilot AI. While we recommend attending all 6 events in the series, each session is independent of one another, and you can join the topics of your interest. Think of it as a “Hop On, Hop Off” bus! Participation is free, but you need a personal computer (laptop) and we provide the rest. We look forward to seeing you there! (April 11, 2024)     April 2024 Cleveland Power Platform User Group (Independence, Ohio) Kickoff the meeting with networking, and then our speaker will share how to create responsive and intuitive Canvas Apps using features like Variables, Search and Filtering. And how PowerFx rich functions and expressions makes configuring those functionalities easier. Bring ideas to discuss and engage with other community members! (April 16, 2024)     Dynamics 365 and Power Platform 2024 Wave 1 Release (NYC, Online) This session features Aric Levin, Microsoft Business Applications MVP and Technical Architect at Avanade and Mihir Shah, Global CoC Leader of Microsoft Managed Services at IBM. We will cover some of the new features and enhancements related to the Power Platform, Dataverse, Maker Portal, Unified Interface and the Microsoft First Party Apps (Microsoft Dynamics 365) that were announced in the Microsoft Dynamics 365 and Power Platform 2024 Release Wave 1 Plan. (April 17, 2024)     Let’s Explore Copilot Studio Series: Bot Skills to Extend Your Copilots (Makati National Capital Reg... Join us for the second installment of our Let's Explore Copilot Studio Series, focusing on Bot Skills. Learn how to enhance your copilot's abilities to automate tasks within specific topics, from booking appointments to sending emails and managing tasks. Discover the power of Skills in expanding conversational capabilities. (April 30, 2024)   Upcoming Dynamics365 Events    Leveraging Customer Managed Keys (CMK) in Dynamics 365 (Noida, Uttar Pradesh, Online) This month's featured topic: Leveraging Customer Managed Keys (CMK) in Dynamics 365, with special guest Nitin Jain from Microsoft. We are excited and thankful to him for doing this session. Join us for this online session, which should be helpful to all Dynamics 365 developers, Technical Architects and Enterprise architects who are implementing Dynamics 365 and want to have more control on the security of their data over Microsoft Managed Keys. (April 11, 2024)     Stockholm D365 User Group April Meeting (Stockholm) This is a Swedish user group for D365 Finance and Operations, AX2012, CRM, CE, Project Operations, and Power BI.  (April 17, 2024)         Transportation Management in D365 F&SCM Q&A Session (Toronto, Online) Calling all Toronto UG members and beyond! Join us for an engaging and informative one-hour Q&A session, exclusively focused on Transportation Management System (TMS) within Dynamics 365 F&SCM. Whether you’re a seasoned professional or just curious about TMS, this event is for you. Bring your questions! (April 26, 2024)   Leaders, Create Your Events!    Leaders of existing User Groups, don’t forget to create your events within the Community platform. By doing so, you’ll enable us to share them in future posts and newsletters. Let’s spread the word and make these gatherings even more impactful! Stay tuned for more updates, inspiring stories, and collaborative opportunities from and for our Community User Groups.   P.S. Have an event or success story to share? Reach out to us – we’d love to feature you. Just leave a comment or send a PM here in the Community!

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

We have closed kudos on this post at this time. Thank you to everyone who kudo'ed their RSVP--your invitations are coming soon!  Miss the window to RSVP? Don't worry--you can catch the recording of the meeting this week in the Community.  Details coming soon!   *****   It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd. at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3rd, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Blogging in the Community is a Great Way to Start

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Topic: Blogging in the Community Are you new to our Communities and feel like you may know a few things to share, but you're not quite ready to start answering questions in the forums? A great place to start is the Community blog! Whether you've been using Power Platform for awhile, or you're new to the low-code revolution, the Community blog is a place for anyone who can write, has some great insight to share, and is willing to commit to posting regularly! In other words, we want YOU to join the Community blog.    Why should you consider becoming a blog author? Here are just a few great reasons. 🎉   Learn from Each Other: Our community is like a bustling marketplace of ideas. By sharing your experiences and insights, you contribute to a dynamic ecosystem where makers learn from one another. Your unique perspective matters! Collaborate and Innovate: Imagine a virtual brainstorming session where minds collide, ideas spark, and solutions emerge. That’s what our community blog offers—a platform for collaboration and innovation. Together, we can build something extraordinary. Showcase the Power of Low-Code: You know that feeling when you discover a hidden gem? By writing about your experience with your favorite Power Platform tool, you’re shining a spotlight on its capabilities and real-world applications. It’s like saying, “Hey world, check out this amazing tool!” Earn Trust and Credibility: When you share valuable information, you become a trusted resource. Your fellow community members rely on your tips, tricks, and know-how. It’s like being the go-to friend who always has the best recommendations. Empower Others: By contributing to our community blog, you empower others to level up their skills. Whether it’s a nifty workaround, a time-saving hack, or an aha moment, your words have impact. So grab your keyboard, brew your favorite beverage, and start writing! Your insights matter and your voice counts! With every blog shared in the Community, we all do a better job of tackling complex challenges with gusto. 🚀   Welcome aboard, future blog author! ✍️✏️🌠 Get started blogging across the Power Platform Communities today! Just follow one of the links below to begin your blogging adventure.   Power Apps: https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/bg-p/PowerAppsBlog Power Automate: https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/bg-p/MPABlog Copilot Studio: https://powerusers.microsoft.com/t5/Copilot-Studio-Community-Blog/bg-p/PVACommunityBlog Power Pages: https://powerusers.microsoft.com/t5/Power-Pages-Community-Blog/bg-p/mpp_blog   When you follow the link, look for the Message Admins button like this on the page's right rail, and let us know you're interested. We can't wait to connect with you and help you get started. Thanks for being part of our incredible community--and thanks for becoming part of the community blog!

Top Solution Authors
Top Kudoed Authors
Users online (5,326)