If(ctxLoadPeople,
//Load People
ClearCollect(colPeople,
AddColumns(Sort(EngineerNames,FullName) As Contact,
Zone,
"People",
PersonaImage,
If(!IsBlank(Contact.EntitiyImage),Substitute(JSON(Contact.EntitiyImage.Value,JSONFormat.IncludeBinaryData),"""","")),
Initials,
Mid(Contact.'First Name',1,1) & Mid(Contact.'Last Name',1,1)
)
);
UpdateContext({ctxLoadPeople:false});
If(ctxLoadDaySlots,
// Create Day Slots
ClearCollect(
colDaySlots,
ForAll(
colPeople As Person,
{
Person: Person,
Days: ForAll(
Sequence(DaysinRange) As Day,
{
PersonId: Person.FullName,
Day: Day.Value,
Zone: $"{Day.Value}|{Person.FullName}"
}
)
}
)
);
UpdateContext({ctxLoadDaySlots:false});
If(ctxTaskEvent,
ClearCollect(
ColTasks,
AddColumns(
ProjectTasks,
TaskName,JobDetails,
Zone,
If(IsBlank('Assigned To'),
"Unassigned",
$"{DateDiff(VarSelectedDate,'Due Date',TimeUnit.Days)+1}|{'Assigned To'.Contact}"
),
Edited,false
)
);
UpdateContext({ctxTaskEvent:false});
);