apps-script-samples icon indicating copy to clipboard operation
apps-script-samples copied to clipboard

getLicenseAssignments pageToken returns null value

Open joef12345 opened this issue 4 years ago • 0 comments

Expected Behavior

getLicenseAssignments should return all the users in the specified domain. PageToken should be populated to allow calling more than 500 results.

url: https://github.com/googleworkspace/apps-script-samples/blob/master/advanced/adminSDK.gs

Actual Behavior

getLicenseAssignments only returns the first page and the PageToken value is null. Also, the while(pageToken) is on the wrong line. It is currently on line 212 and should be on line 220.

Steps to Reproduce the Problem

  1. Call getLicenseAssignments and request 500 as the max result. Assuming there are more than 500 users, you should get a list of 500 users.
  2. Change maxResults to 1 and you should only get one result and pagetoken is null.

joef12345 avatar Mar 30 '21 12:03 joef12345