---
name: "groupId"
type: command
status: ok
groups: ["Groups"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/groupId
revid: 337336
updated: 2023-01-18T11:45:01Z
---

# groupId

*Command · Groups · Arma 3 v0.50*

Locality: arguments **global**

## Description

Returns a group's name or a unit's group ID number.

## Syntax

### Syntax 1

```sqf
groupId group
```

**Parameters:**

- `group`: [Group](../topics/Group.md)

**Returns:** [String](../topics/String.md) - the group's name (e.g "Alpha Red")

### Syntax 2

*since arma3 2.12*

```sqf
groupId unit
```

**Parameters:**

- `unit`: [Object](../topics/Object.md) - a group's unit

**Returns:** [Number](../topics/Number.md) - the unit's group ID (e.g "**2**, taking command")

## Examples

### Example 1

```sqf
_name = groupId group player;            // e.g "B Alpha 1-1"
```

### Example 2

```sqf
private _unitGroupId = groupId player;    // e.g 3 (number, not a string)
```

## See also

[setGroupId](../commands/setGroupId.md) · [setGroupIdGlobal](../commands/setGroupIdGlobal.md) · [group](../commands/group.md)

<sub>Source: [BI Community Wiki — groupId](https://community.bistudio.com/wiki/groupId) (revision 337336).</sub>
