web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Groups.ListGr...
Power Apps
Unanswered

Office365Groups.ListGroupMembers - large group to be added into App Onstart Collection

(0) ShareShare
ReportReport
Posted on by 7
 
I have a piece of code which resides in the App OnStart.  It should collect a list of users within a group utilising the skip token to achieve paging of data.  It should grab 100 x 100 records which it does, however, it is 100 lots of the same data.  The skip token seems to be ignored.  I cannot see why this does not work.
 
Set(gblInstalledTeamsID,#Guid#);
Clear(AllUsers);
ForAll(
    Sequence(100),
    With(
        Office365Groups.ListGroupMembers(gblInstalledTeamsID,
            {
                '$skiptoken': Last(AllUsers).SKIP_TOKEN
            }
        ) As _user,
        With(
            {_skipToken: Last(Split(_user.'@odata.nextLink', "=")).Value},
            Collect(AllUsers, AddColumns(_user.value, SKIP_TOKEN, _skipToken));
        )
    )
);
 
This is a filtered result of the top two collection entries showing the varied token:
 
Test (xTRUST)
RFNwdAoAAQAAAAAAAAAAFAAAAMGLf-o-hHJJsDz52XoUemIBAAAAAAAAAAAAAAAAAAAXMS4yLjg0MC4xMTM1NTYuMS40LjIzMzEGAAAAAAABtTn_TX7CIE6Q7shZvEfhVwEwAAAAAQAAAAA
Test (x TRUST)
RFNwdAoAAQAAAAAAAAAAFAAAAH-lf6s9lKZBsdCx9yAAWA4BAAAAAAAAAAAAAAAAAAAXMS4yLjg0MC4xMTM1NTYuMS40LjIzMzEGAAAAAAABtTn_TX7CIE6Q7shZvEfhVwEwAAAAAQAAAAA
 
 
The below script works for list groups, so I need to know why the above script does not work for list group members.
Clear(col_groups1);
ForAll(
    Sequence(3),
    With(
        Office365Groups.ListGroups(
            {
                '$skiptoken': Last(col_groups1).SKIP_TOKEN
            }) As _user,
        With(
            {_skipToken: Last(Split(_user.'@odata.nextLink', "=")).Value},
            Collect(col_groups1, AddColumns(_user.value, SKIP_TOKEN, _skipToken));
        )
    )
);
Categories:
I have the same question (2)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard