---
title: "userGroups"
canonical: "https://support.appfire.com/space/PSCONF/15304532/userGroups"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | userGroups(userName) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Returns the groups where the selected user belongs.

Returns the groups where the selected user belongs.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | userName | String | Yes | User name of the user to get groups for. |

## Return Type

**String []**

Returns an array of groups where the selected user belongs.

## Example

```javascript
string[] groups = userGroups("jdoe");
```

## See also

> Macro (contentbylabel)