If(
IsMatch(
Self.URL,
"https://",
MatchOptions.BeginsWith
),
With(
{
MyAPIcall: Office365Groups.HttpRequest(
Self.URL,
"GET",
""
)
},
Collect(
CollectionThatYouWillStoreTheData, //Name it as you wish
ForAll(
Table(MyAPIcall.value),
{
ID: Value(Value.id),
Title: Text(Value.fields.Title),
Name: Text(Value.fields.NAME), //repeat for all columns you want to fetch
Numbers: Value(Value.fields.ANUMBERCOLUMN) //repeat for all columns you want to fetch
}
)
);
Set(
GraphAPIURL,
Text(MyAPIcall.'@odata.nextLink')
)
)
)
Step 3:
Add this Component to the screen where you would do the operation (Insert > Custom > Looper component). You can make it invisible or 0x0 px.
Step 4 (optional button): I created a button to start the API call, but if you want to connect it to an event or an OnStart or anything you can use that
Set the Button OnClick to this:
Clear(CollectionThatYouWillStoreTheData); /just in case you press it twice accidentally you don't want duplicate records.
Set(GraphAPIURL, "https://graph.microsoft.com/v1.0/sites/[Your Site ID]/lists/[Your List ID]/items?$expand=fields($select=Title,NAME,ANUMBERCOLUMN)&$top=5000")
Replace NAME, ANUMBERCOLUMN with any columns you also want to store in the collection and make sure you include them in the OnReset as well. ID is default here, you don't need to add it.
What it does, is it fetches the first 5000 rows from your sharepoint list, and if there is a 'nextLink' parameter in the response, it will trigger a Reset in the component which then runs the query again for the next 5000 rows.
Now you have a collection with all the rows and you can do the filtering and count rows.