# getGroupsByUserId {#getgroupsbyuserid}

## Syntax {#syntax}

`getGroupsByUserId(userId)`

## Arguments {#arguments}

**userId** is a string indicating a user name.

## Details {#details}

Return a STRING vector of the group names that the user belongs to. It can only be executed by an administrator.

## Examples {#id_dm4_jc5_hzb}

``` {#codeblock_km4_jc5_hzb}
getGroupsByUserId("admin")
// output: ["MVP","MYMVP"]
```

