cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GuruJetti
Frequent Visitor

Retrieve logged in User associated teams in canvas app

Hello All,

Could you please advise me on the below requirement and i have tried some options but couldn't get the expected results. In Dataverse we have table named "Teams", i want to display the teams that are associated to current logged in user. For instance we have users x ,y and z, they have access to teams  X => abc , X => xyz  and Y=>xyz , Z=>bbc

expected result is when X logged in on Canvas app , we need to show abc and xyz team names in the dropdown and filter the gallary to show the items related to selected team. Please do let me know more details needed for the same and appreciate the suggestions.

2 ACCEPTED SOLUTIONS

Accepted Solutions
MayankP
Responsive Resident
Responsive Resident

@GuruJetti  I guess it is same or similar for drop down..

 

MayankP_0-1628263230092.png

 

 

so put this as filter on dropdown ....Filter(Teams, 'Teams (Views)'.'My Owner Teams') [as shown in screen print above]

 

View solution in original post

GuruJetti
Frequent Visitor

Thanks @MayankP , i did the same and working as expected.

View solution in original post

7 REPLIES 7
cchannon
Super User
Super User

User and Team are related by an N:N intersect entity called teammembership. Team membership has an attribute "systemuserid" and another attribute, "teamid" which are pointers to the related records. 

 

So, if you query for all teammembership rows where systemuserid == {current user id} then the teamid values on those rows are all teams which this user is a member of.

MayankP
Responsive Resident
Responsive Resident

Hello,

 

I guess you could this using out of box view settings as shown in screen print below..

 

MayankP_0-1628256208185.png

 

so I just put gallery control and selected data source as Teams (which should display all teams) and then filter data view as shown in screen print above...

 

refer this article for further information https://debajmecrm.com/filter-gallery-in-canvas-app-dynamically-on-cds-entity-views/

 

 

Thanks for the response @cchannon , will try it

GuruJetti
Frequent Visitor

Thanks for the response @MayankP  , will try it and i need to display these in the dropdown and selected owner team records will be displayed in the Gallary. Looking to Bind the teams view to Dropdown.

MayankP
Responsive Resident
Responsive Resident

@GuruJetti  I guess it is same or similar for drop down..

 

MayankP_0-1628263230092.png

 

 

so put this as filter on dropdown ....Filter(Teams, 'Teams (Views)'.'My Owner Teams') [as shown in screen print above]

 

GuruJetti
Frequent Visitor

Thanks @MayankP , i did the same and working as expected.

Hi @cchannon - please share code sample for better understanding

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (2,537)