cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
duncant
Helper V
Helper V

Identify Office365 User Group

When using Office365User connection in PowerApp, how can this connection be used to identify if the current user is in a specific Office 365 User Group?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @duncant ,

Do you want to justify whether current user is in a specific Office 365 User Group?

I'm afraid it's not supported to do this by only using the connector of Office365 Users.

You could only get user own information by using the connector of Office365 Users, not including group information.

You need to connect with Office365 Groups to get group information.

Could you tell me what information of the specific Office 365 User Group that you've got?

I've made a similar test for your reference:

1)If you've got the specific Office 365 User Group's Name, you could set a label's Text:

If(groupname in Office365Groups.ListOwnedGroupsV3().value.displayName,true,false)

//groupname is the specific Office 365 User Group's Name

Office365Groups.ListOwnedGroupsV3().value will list all the groups that current user owns and belongs to

If the result is true, then current user is in the specific Office 365 User Group.

If the result is false, then current user is not in the specific Office 365 User Group.

2)If you've got the specific Office 365 User Group's Email, you could set a label's Text:

 

If(groupname in Office365Groups.ListOwnedGroupsV3().value.mail,true,false)

 

3)If you've got the specific Office 365 User Group's id, you could set a label's Text:

 

If(groupname in Office365Groups.ListOwnedGroupsV3().value.id,true,false)

 

 

This is the fields that you will get from the function Office365Groups.ListOwnedGroupsV3().value.

396.PNG

 

You could justify the result that you want based on any field of this table.

Here's a doc about this connector your reference:

https://docs.microsoft.com/en-us/connectors/office365groups/#listownedgroups_response

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

The Office365User connection doesn't contain information on the groups.  But there is an Office365Groups connector. Using that you can get the list of group members in a group and check to see if a particular user is a member.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

v-yutliu-msft
Community Support
Community Support

Hi @duncant ,

Do you want to justify whether current user is in a specific Office 365 User Group?

I'm afraid it's not supported to do this by only using the connector of Office365 Users.

You could only get user own information by using the connector of Office365 Users, not including group information.

You need to connect with Office365 Groups to get group information.

Could you tell me what information of the specific Office 365 User Group that you've got?

I've made a similar test for your reference:

1)If you've got the specific Office 365 User Group's Name, you could set a label's Text:

If(groupname in Office365Groups.ListOwnedGroupsV3().value.displayName,true,false)

//groupname is the specific Office 365 User Group's Name

Office365Groups.ListOwnedGroupsV3().value will list all the groups that current user owns and belongs to

If the result is true, then current user is in the specific Office 365 User Group.

If the result is false, then current user is not in the specific Office 365 User Group.

2)If you've got the specific Office 365 User Group's Email, you could set a label's Text:

 

If(groupname in Office365Groups.ListOwnedGroupsV3().value.mail,true,false)

 

3)If you've got the specific Office 365 User Group's id, you could set a label's Text:

 

If(groupname in Office365Groups.ListOwnedGroupsV3().value.id,true,false)

 

 

This is the fields that you will get from the function Office365Groups.ListOwnedGroupsV3().value.

396.PNG

 

You could justify the result that you want based on any field of this table.

Here's a doc about this connector your reference:

https://docs.microsoft.com/en-us/connectors/office365groups/#listownedgroups_response

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sorry, but I disagree.  

ListOwnedGroupsV3

only returns the list of groups "owned" by the user, not the groups the user is a member of.  The original question was asking to find out if a user was a member.  This code won't achieve that unless the user is also the owner of the group. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Hi @Pstork1 ,

What you are talking about is ListOwnedGroups_V2 function.

ListOwnedGroups_V2 only returns the group that you own.

ListOwnedGroups_V3 returns the group that you own and belong to.

You could refer this doc:

https://docs.microsoft.com/en-us/connectors/office365groups/#list-groups-that-i-own-and-belong-to

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the update.  I stand corrected.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

james_hathaway
Advocate III
Advocate III

@v-yutliu-msft ,

 

I am trying to use the 

Office365Groups.ListOwnedGroupsV3().value
function, but I too am only getting a blank collection as a result.
 
Is this function actually working properly?
Are there some other permissions that need to be set up in AD? (Like Graph API permissions?)
 
Interestingly, I tested the same function directly in the Graph API explorer, and I got the results I was expecting (3 Groups):
 
Any Idea why the ListOwnedGroupsV3() function doesn't result any results?
 
James.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,506)