teamlink icon indicating copy to clipboard operation
teamlink copied to clipboard

Flat team structure

Open tdashworth opened this issue 3 years ago • 18 comments

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?

tdashworth avatar Jan 26 '22 09:01 tdashworth

Hi Tom. So you've modified the app to show the members of the Team that it is installed into?

stuartridout avatar Feb 03 '22 12:02 stuartridout

Hi @stuartridout,

This is the primary change we've made: image

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!

tdashworth avatar Feb 10 '22 16:02 tdashworth

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 avatar Feb 17 '22 12:02 MathieuWuyts

@MathieuWuyts I've already achieved this in my previous comment. I updated both the OnVisible and OnSelect.

tdashworth avatar Feb 17 '22 12:02 tdashworth

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.

MathieuWuyts avatar Feb 17 '22 12:02 MathieuWuyts

Seems easier with a picture: image

MathieuWuyts avatar Feb 17 '22 12:02 MathieuWuyts

@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.

tdashworth avatar Feb 17 '22 13:02 tdashworth

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 avatar Feb 17 '22 13:02 MathieuWuyts

@MathieuWuyts I'm also noticing a lot of ; in for code that should be ,.

tdashworth avatar Feb 17 '22 13:02 tdashworth

Wow you were right. Sloppy. This is what I have now for the OnSelect My Team/Peers button: image

Still got errors, saying unexpected characters(?)

MathieuWuyts avatar Feb 17 '22 13:02 MathieuWuyts

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 😄

tdashworth avatar Feb 17 '22 14:02 tdashworth

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

MathieuWuyts avatar Feb 17 '22 14:02 MathieuWuyts

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"
    )

tdashworth avatar Feb 17 '22 14:02 tdashworth

image image

MathieuWuyts avatar Feb 17 '22 15:02 MathieuWuyts

Looks like a new gallery works correct: image

MathieuWuyts avatar Feb 17 '22 15:02 MathieuWuyts

I get these red things when trying: image

MathieuWuyts avatar Feb 17 '22 15:02 MathieuWuyts

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 avatar Feb 17 '22 16:02 tdashworth

@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

lazo8592 avatar Apr 19 '24 11:04 lazo8592