Now to your issue - you are wanting to update a roster list with a running standard fortnight. Assuming your "master" list
RosterList has the field names (you did not post any headers, so I have assumed them)
RosterDate,
DayShift,
NightShift and
YesNo and your roster template
TemplateList has the last three fields (you do not need a date), providing the last date in
RosterList is a Sunday, then running this will incrementally update
RosterList two weeks at a time, adding the data automatically.
With(
{
_Data: RosterList,
_Date: First(
Sort(
ShiftList,
RosterDate,
SortOrder.Descending
)
).RosterDate
},
ForAll(
Sequence(CountRows(_Data)) As _D,
Patch(
ShiftList,
Defaults(ShiftList),
{
RosterDate: DateAdd(
_Date,
_D.Value,
TimeUnit.Days
),
DayShift: Index(
_Data,
_D.Value
).DayShift,
NightShift: Index(
_Data,
_D.Value
).NightShift,
YesNo: Index(
_Data,
_D.Value
).YesNo
}
)
)
)
Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
MVP (Business Applications) Visit my blog Practical Power Apps LinkedIn