Open tdashworth opened 2 years ago
Hi Tom. So you've modified the app to show the members of the Team that it is installed into?
Hi @stuartridout,
This is the primary change we've made:
It does impact performance with a new team of 150+ but the "Peers" model isn't ideal for us. I've suggested to the team we used the pinned and sites view predominately.
Once again, great app!
We would like to implement the function to see all the members of the Team it is installed in. Is this possible? If it's easy to code I could implement it instead of the Peers view
@MathieuWuyts I've already achieved this in my previous comment. I updated both the OnVisible and OnSelect.
That's what I thought. I tried implementing it:
Set( hasLoaded; false );; Switch(teamViewType;"Directs";ClearCollect(thisTeamList;Office365Users.DirectReportsV2(teamViewParentEmail).value.mail);"Peers"; //Clear(thisTeamList);; //Patch(thisTeamList;Defaults(thisTeamList);{mail:Office365Users.ManagerV2(teamViewParentEmail).mail});; //ClearCollect(thisTmpTeamList;Office365Users.DirectReportsV2(Office365Users.ManagerV2(teamViewParentEmail).mail).value.mail));; //Collect(thisTeamList;SortByColumns(thisTmpTeamList;"mail";Ascending));; ClearCollect( thisTeamList; RenameColumns( ShowColumns( Filter( Users; Status = ‘Status (Users)’.Enabled; EndsWith(‘Primary Email’; “@xxx.xx”) ); “internalemailadress” ); “internalemailadress”; “mail” ) );
If(teamViewType="Directs"||teamViewType="Pinned";ClearCollect( teamViewAvailability; Filter( Presences; Email in thisTeamList.mail ) ));; Set( hasLoaded; true );;
This changes nothing tho. Please note this is also my first try at Power Apps; and I don't know where I can find OnSelect.
Seems easier with a picture:
@MathieuWuyts you'll need to change the domain name (@xxx.xxx
) to match your organisation. We found there were additional users which we wanted to filter out.
That I get, that's done in mine. I also changed the My Team button with the filter, but I get errors saying there is an operator expected, but I don't see where
@MathieuWuyts I'm also noticing a lot of ;
in for code that should be ,
.
Wow you were right. Sloppy. This is what I have now for the OnSelect My Team/Peers button:
Still got errors, saying unexpected characters(?)
This is what we have exactly.
Edit Presence and View Any Team.OnVisible =
Set(
hasLoaded,
false
);
Switch(
teamViewType,
"Directs",
ClearCollect(
thisTeamList,
Office365Users.DirectReportsV2(teamViewParentEmail).value.mail
),
"Peers",
Clear(thisTeamList);
//Patch(
// thisTeamList,
// Defaults(thisTeamList),
// {mail: Office365Users.ManagerV2(teamViewParentEmail).mail}
//);
//ClearCollect(
// thisTmpTeamList,
// Office365Users.DirectReportsV2(Office365Users.ManagerV2(teamViewParentEmail).mail).value.mail
//);
ClearCollect(
thisTeamList,
RenameColumns(
ShowColumns(
Filter(
Users,
Status = 'Status (Users)'.Enabled,
EndsWith('Primary Email', "@example.com")
),
"internalemailaddress"
),
"internalemailaddress",
"mail"
)
);
);
//Collect(
// thisTeamList,
// SortByColumns(
// thisTmpTeamList,
// "mail",
// Ascending
// )
//);
If(
teamViewType = "Directs" || teamViewType = "Pinned",
ClearCollect(
teamViewAvailability,
Filter(
Presences,
Email in thisTeamList.mail
)
)
);
Set(
hasLoaded,
true
);
btnMyPeers.OnSelect =
Set(
startTimer,
false
);
Set(
hasLoaded,
false
);
/*Load Team*/
Set(
teamViewParentEmail,
myMail
);
Set(
teamViewType,
"Peers"
);
//Clear(thisTeamList);
//Patch(thisTeamList,Defaults(thisTeamList),{mail:Office365Users.ManagerV2(teamViewParentEmail).mail});
//ClearCollect(thisTmpTeamList,Office365Users.DirectReportsV2(Office365Users.ManagerV2(teamViewParentEmail).mail).value.mail);
//Collect(thisTeamList,SortByColumns(thisTmpTeamList,"mail",Ascending));
ClearCollect(
thisTeamList,
RenameColumns(
ShowColumns(
Filter(
Users,
Status = 'Status (Users)'.Enabled,
EndsWith('Primary Email', "@example.com")
),
"internalemailaddress"
),
"internalemailaddress",
"mail"
)
);
ClearCollect(
teamViewAvailability,
Filter(
Presences,
Email in thisTeamList.mail
)
);
Set(
startTimer,
true
);
I hope this helps 😄
Literally copied it, when I press the My Team button in the preview it doesn't do anything. The Pinned List stays open. When I press the Pinned List button the list refreshes, but the My Team button doesn't load.
Also maybe edit the email out
Hummm, are you getting any errors you can share?
If you are comfortable with Power Apps, try creating a new screen with a gallery and apply the same source. Does that work?
RenameColumns(
ShowColumns(
Filter(
Users,
Status = 'Status (Users)'.Enabled,
EndsWith('Primary Email', "@example.com")
),
"internalemailaddress"
),
"internalemailaddress",
"mail"
)
Looks like a new gallery works correct:
I get these red things when trying:
On the new gallery page, you need to set the above formula to the Gallery.Items property, not OnVisible. If it works, it should list the users' email addresses.
Try these formulas without the commented lines. Also, I notice you still have "example.com" in your screenshots.
Edit Presence and View Any Team.OnVisible =
Set(
hasLoaded,
false
);
Switch(
teamViewType,
"Directs",
ClearCollect(
thisTeamList,
Office365Users.DirectReportsV2(teamViewParentEmail).value.mail
),
"Peers",
ClearCollect(
thisTeamList,
RenameColumns(
ShowColumns(
Filter(
Users,
Status = 'Status (Users)'.Enabled,
EndsWith('Primary Email', "@example.com")
),
"internalemailaddress"
),
"internalemailaddress",
"mail"
)
);
);
If(
teamViewType = "Directs" || teamViewType = "Pinned",
ClearCollect(
teamViewAvailability,
Filter(
Presences,
Email in thisTeamList.mail
)
)
);
Set(
hasLoaded,
true
);
btnMyPeers.OnSelect =
Set(
startTimer,
false
);
Set(
hasLoaded,
false
);
/*Load Team*/
Set(
teamViewParentEmail,
myMail
);
Set(
teamViewType,
"Peers"
);
ClearCollect(
thisTeamList,
RenameColumns(
ShowColumns(
Filter(
Users,
Status = 'Status (Users)'.Enabled,
EndsWith('Primary Email', "@example.com")
),
"internalemailaddress"
),
"internalemailaddress",
"mail"
)
);
ClearCollect(
teamViewAvailability,
Filter(
Presences,
Email in thisTeamList.mail
)
);
Set(
startTimer,
true
);
@tdashworth @stuartridout
Hi guys, is there a way with Teamlink to add another row for presence i.e. if someone is at an event in addition to the other options like Home or Office. Pleas help, thanks
Our team contains about 50 members with multiple levels of management in a "reviewer tree". Therefore, looking at my manager's reports is not sufficient to represent the entire team.
We have modified the app to instead pull the user list from Dataverse for Teams filtering out disabled users.
Could this be another option built into the app?