cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
firektl
Helper III
Helper III

Return only members - Office365Groups.ListGroupMembers

Greetings to the community, I am new in the development of Power Apps and my questions is the following:

 

I am using the AttendanceApp tyo take attendance, I would like to know if the in any way that the Office.365Group.ListGroupMembers function returns only our members, currently it also takes the owners.

 

The information that the function returns is stored in a SharePoint list, what I want is to be able to filter the information so that it does not insert the owners in the SharePoint list  

 

 

ForAll(
    Office365Groups.ListGroupMembers(ClassDropdown.Selected.id).value;
    Collect(
        AttendanceRecord;
        {
            Title: GUID();
            LessonId: attendance_list_guid;
            Attendance: "Not taken";
            ClassId: ClassDropdown.Selected.id;
            LessonDate: TakeAttendanceDatePicker.SelectedDate;
            StudentEmailId: Mail;
            AttendanceTakenBy: "";
            EndTime: Concatenate(
                EndHourDropdown.Selected.Value;
                ":";
                EndMinDropdown.Selected.Value
            );
            StartTime: Concatenate(
                StartHourDropdown.Selected.Value;
                ":";
                StartMinDropdown.Selected.Value
            );
            StudentName: DisplayName;
            ClassName:ClassDropdown.Selected.displayName
        }
    )
);;

 

 

Thank you very much who can help me.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @firektl :

Do you want to get the list of members in the group that does not contain the owners?

If so,It will be a tough work.You will face the following two difficulties:

  • Because the group member contains owers, that is to say, to get all members who are not owners, you need to get the owners list first. Then delete these owners from the members list.
  • Currently, the list of owners cannot be obtained through the standard connector. In other words, you could consider create a custom connector based on the Microsoft Graph Rest API within your PowerApps to achieve your needs.

Please refer to the following process:

Step1: get all the members through Office365Groups.ListGroupMembers().

Step2: use your custom connector to get all owners in that group.

Step3:use the owner list obtained in the step2 as a filter condition to filter the member list obtained in the step1.

I think these links will help you a lot:

Best Regards,

Bof

 

 

 

 

View solution in original post

4 REPLIES 4
gabibalaban
Super User
Super User

Well ..... I'm affraid you are mistaken. 

Office.365Group.ListGroupMembers function returns only the members of the group. 

 

Please remove from Microsoft 365 admin center, the group owners from members and you'll get the desired results.

 

 

Hi @gabibalaban,


Thanks for your answer, I tell you that from Microsoft Teams when I see the "Owners" and "Members" it shows them separately, but when I see them from the Microsoft 365 administration center I see the users who are owners and members as members. when doing the query with Office365.Groups.ListMembers it returns all together. I attach the image.

 

img1.PNG.png

 

img2.PNG

 

 

To test your recommendation, remove the "Fiorela" user as a team member from the Microsoft admin center but when using the Office365Groups.ListOwnedGroups().value function does not show the group.

 

The Office365Groups.ListOwnedGroups ().value function was previously used to list the computers to which a user belongs.

 

Hi @firektl :

Do you want to get the list of members in the group that does not contain the owners?

If so,It will be a tough work.You will face the following two difficulties:

  • Because the group member contains owers, that is to say, to get all members who are not owners, you need to get the owners list first. Then delete these owners from the members list.
  • Currently, the list of owners cannot be obtained through the standard connector. In other words, you could consider create a custom connector based on the Microsoft Graph Rest API within your PowerApps to achieve your needs.

Please refer to the following process:

Step1: get all the members through Office365Groups.ListGroupMembers().

Step2: use your custom connector to get all owners in that group.

Step3:use the owner list obtained in the step2 as a filter condition to filter the member list obtained in the step1.

I think these links will help you a lot:

Best Regards,

Bof

 

 

 

 

Hi 

 

Thanks for you explantion, I will put it into practice.

 

 

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!

Top Solution Authors
Top Kudoed Authors
Users online (4,041)