class GroupsApp method .getGroups()

GroupsApp is the Apps Script service.

.getGroups() is the method name you will see after a dot in your code.

What it does

Returns the Google Groups the user belongs to.

Why it's used

  • List every group the user belongs to for an audit sheet.
  • Pick which group to manage in a dropdown-driven tool.

Common errors

  • Forgetting parentheses on getGroups. Write GroupsApp.getGroups(), not GroupsApp.getGroups or getGroups by itself.
  • Skipping dots between chained calls. Each step needs a dot, like GroupsApp.getGroups().
  • Adding spaces where they do not belong. Write GroupsApp.getGroups(), not GroupsApp .getGroups(), GroupsApp.getGroups (), or GroupsApp . getGroups().
  • Wrong capitalization. Use GroupsApp and getGroups, not groupsapp or getgroups.

Explore

Related methods

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about GroupsApp.getGroups().

Browse the blog