@mdevaney Below is the code, it is based off of the Onboarding Tasks template canvass app...
Set(MyGroup,LookUp(OutlookTasks.GetTaskGroups(),Name = "My Tasks"));
Set(MyOutlookGroupId, MyGroup.Id);
Set(MyProfile,Office365Users.MyProfileV2());
Set(MyUserId,MyProfile.userPrincipalName);
Set(MyUserDisplayName,MyProfile.displayName);
Set(MyUserEmail,MyProfile.mail);
Set(SelectedUser,MyUserId);
ClearCollect(UserPhotoCache,
{
UserId:MyUserId,
Photo:If(Office365Users.UserPhotoMetadata(MyUserId).HasPhoto,Office365Users.UserPhotoV2(MyUserId),'default-profile'),
Time:Now()
});
Set(
SelectedUserProfile,
{
DisplayName:MyProfile.displayName,
City:MyProfile.City,
JobTitle:MyProfile.jobTitle,
UserPrincipalName:MyProfile.userPrincipalName,
GivenName:MyProfile.givenName,
Mail:MyProfile.mail,
Id:MyProfile.id,
Mobile:MyProfile.mobilePhone,
OfficePhone:MyProfile.TelephoneNumber,
Department:MyProfile.Department,
OfficeLocation:MyProfile.officeLocation,
Photo: LookUp(UserPhotoCache,UserId = MyUserId).Photo
}
);
ClearCollect(
MyReportList,
ForAll(
Office365Users.DirectReports(MyUserId),
{
DisplayName:DisplayName,
City:City,
JobTitle:JobTitle,
UserPrincipalName:UserPrincipalName,
GivenName:GivenName,
Mail:Mail,
Id:Id,
Mobile:mobilePhone,
OfficePhone:TelephoneNumber,
Department:Department,
OfficeLocation:OfficeLocation,
Photo:If(
Not(Id in UserPhotoCache.UserId),
Collect(UserPhotoCache,
{
UserId:Id,
Photo:If(Office365Users.UserPhotoMetadata(Id).HasPhoto,Office365Users.UserPhotoV2(Id),'default-profile'),
Time:Now()
}
);
LookUp(UserPhotoCache,UserId = Id).Photo,
LookUp(UserPhotoCache,UserId = Id).Photo)
}
)
);
ClearCollect(
MyPeersList,
ForAll(
Office365Users.DirectReports(Office365Users.Manager(MyUserId).Id),
{
DisplayName:DisplayName,
City:City,
JobTitle:JobTitle,
UserPrincipalName:UserPrincipalName,
GivenName:GivenName,
Mail:Mail,
Id:Id,
Mobile:mobilePhone,
OfficePhone:TelephoneNumber,
Department:Department,
OfficeLocation:OfficeLocation,
Photo:If(
Not(Id in UserPhotoCache.UserId),
Collect(
UserPhotoCache,
{
UserId:Id,
Photo:If(Office365Users.UserPhotoMetadata(Id).HasPhoto,Office365Users.UserPhotoV2(Id),'default-profile'),
Time:Now()
}
);
LookUp(UserPhotoCache,UserId = Id).Photo,
LookUp(UserPhotoCache,UserId = Id).Photo
)
}
)
);
Set(ManagerProfile,Office365Users.Manager(MyUserId));