googleworkspace / apps-script-samples

Apps Script samples for Google Workspace products.
https://developers.google.com/apps-script
Apache License 2.0
4.5k stars 1.83k forks source link

Num Docs from generateUserUsageReport returns undefined #126

Closed ianhyzy closed 2 years ago

ianhyzy commented 5 years ago

Expected Behavior

generateUserUsageReport should tell me how many new Docs a user made in the last week.

Actual Behavior

Right now, it returns "undefined". image

Steps to Reproduce the Problem

  1. Paste the script
  2. Run it
  3. See undefined instead of the corect number
erickoledadevrel commented 5 years ago

I tried reproduce this, but it's returning a number in my test account. What edition of G Suite are you using?

ianhyzy commented 5 years ago

All users on the target domain have Enterprise.

ianhyzy commented 5 years ago

Apologies, I should have mentioned this earlier - I was running this script inside of app maker and made sure I had all the advanced services turned on, so I assumed it wouldn't matter - but this script works fine on scripts.google.com for me, just not as an AM server script. I was under the impression that server scripts were the same as appscripts and I' wondering why only this one component seems to be affected by this?

I had all these services enabled on the project in case one of them was the issue: image

erickoledadevrel commented 5 years ago

Ah, that's very useful information, thanks for confirming. And both times the code is run as the same user, who is a super admin in the G Suite organization?

ianhyzy commented 5 years ago

Both times the code is run from the same superadmin account, right.

sqrrrl commented 2 years ago

Closing since this seems to be specific to app maker which is no longer available.