cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Johany_Navarro
Helper I
Helper I

Groups member of Groups in Azure

Hi, you all legends.

 

I hope you all are well and safe.

 

I have many groups member of other groups like below.

- AuditStaff

   *AuditStaff_Managers

   *AuditStaff_Senior3
   *AuditStaff_Senior2

   *AuditStaff_Senior1

   *etc...

 

Like that with all the departments, then when I try to use AzureAD.CheckMemberGroupsV2 to get the members of AuditStaff group what I get is a list of groups 😯.

 

Is there any way to get the users in the groups, not the groups?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Johany_Navarro ,

 

I made a formula according to the structure of your groups.

You could try this formula on your onvisible property of screen:

1\

ClearCollect(

    Test,

    Filter(

        Ungroup(

            ForAll(

                Ungroup(

                    ForAll(

                        AzureAD.GetGroupMembers("your group id").value.id,

                        AzureAD.GetGroupMembers(id)

                    ),

                    "value"

                ),

                If(

                    IsBlank(userPrincipalName),

                    AzureAD.GetGroupMembers(id)

                )

            ),

            "value"

        ),

        !IsBlank(userPrincipalName)

    ),

    ForAll(

        Ungroup(

            ForAll(

                AzureAD.GetGroupMembers("your group id").value.id,

                AzureAD.GetGroupMembers(id)

            ),

            "value"

        ),

        If(

            !IsBlank(userPrincipalName),

            ThisRecord

        )

    )

)

2\  Add a dropdown control and set Its Items property to:

Test

 

In addition, this formula only applies to your current structure.

If you modify the structure of your group, then the formula also needs to be modified.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

View solution in original post

6 REPLIES 6
v-xiaochen-msft
Community Support
Community Support

Hi @Johany_Navarro ,

 

Could you tell me:

Do you want to get all the member information in a certain group?

 

If so ,you could use AzureAD.GetGroupMembers() function.

 

You could try the following formula:

AzureAD.GetGroupMembers("your group id").value

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

Hi @v-xiaochen-msft 

 

Thanks for your reply.

 

Sorry, my bad I wrote CheckMemberGroupsV2 instead od GetGroupMembers.

 

The issue is this, I need to show all members of AuditStaff group, which is a department, in a Combobox but the members of AuditStaff are more groups, the position of the employees, like ASSAUD_MM, ASSAUD_MS and ASSAUD_MA, obviously, I need to show the end-users, not the groups. 

 

see attachments pls.

 

Thanks

v-xiaochen-msft
Community Support
Community Support

Hi @Johany_Navarro ,

 

Could you tell me:

  • Is your group structure the same as the picture below?

v-xiaochen-msft_0-1610949492396.png

If so, you could try the following formula:

Ungroup(ForAll(AzureAD.GetGroupMembers("your group id").value.id,AzureAD.GetGroupMembers(id).value),"Value")

 

I am still confused why you use the CheckMemberGroupsV2() function instead of the GetGroupMembers() function.

v-xiaochen-msft_1-1610950299928.png

 

In addition, It can only get members but not owners.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Johany_Navarro
Helper I
Helper I

Hi @v-xiaochen-msft 

Hope you still well.

Many thanks for spending some time on my question, nevermind about the CheckMemberGroupV2() it was just a typing error, I'm using GetGroupMember().

 

I'm afraid my scenario is a bit more complex, like below

 

Johany_Navarro_1-1610984688186.png

I need to get the list of members in those groups, unfortunately, the formula that you, very kindly, shared works for GroupB but not for GroupC.

v-xiaochen-msft
Community Support
Community Support

Hi @Johany_Navarro ,

 

I made a formula according to the structure of your groups.

You could try this formula on your onvisible property of screen:

1\

ClearCollect(

    Test,

    Filter(

        Ungroup(

            ForAll(

                Ungroup(

                    ForAll(

                        AzureAD.GetGroupMembers("your group id").value.id,

                        AzureAD.GetGroupMembers(id)

                    ),

                    "value"

                ),

                If(

                    IsBlank(userPrincipalName),

                    AzureAD.GetGroupMembers(id)

                )

            ),

            "value"

        ),

        !IsBlank(userPrincipalName)

    ),

    ForAll(

        Ungroup(

            ForAll(

                AzureAD.GetGroupMembers("your group id").value.id,

                AzureAD.GetGroupMembers(id)

            ),

            "value"

        ),

        If(

            !IsBlank(userPrincipalName),

            ThisRecord

        )

    )

)

2\  Add a dropdown control and set Its Items property to:

Test

 

In addition, this formula only applies to your current structure.

If you modify the structure of your group, then the formula also needs to be modified.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

 

View solution in original post

Johany_Navarro
Helper I
Helper I

Many many many thanks... YOU ARE A LEGEND

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,637)