# CreateGroup Method

## Overloads

| [CreateGroup(String, NxGroupDef, String)](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Engine.GenericObject.CreateGroup.htm#Qlik_Engine_GenericObject_CreateGroup_System_String_Qlik_Engine_NxGroupDef_System_String_) |  | You can use the CreateGroup method with any object that contains an object grouping definition.<br><br>This method allows you to create a new subgroup of objects directly and add it to a group's members.<br><br>Returns the ID of the created subgroup. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.GenericObject.CreateGroup.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.GenericObject.CreateGroup.htm)

## CreateGroup(String, NxGroupDef, String)

You can use the CreateGroup method with any object that contains an object grouping definition.

This method allows you to create a new subgroup of objects directly and add it to a group's members.

Returns the ID of the created subgroup.

### Declaration

```

          public string CreateGroup([QixName("qPath")] string path, [QixName("qGroupDef")] NxGroupDef groupDef, [QixName("qTargetGroupId")] string targetGroupId = null)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | path | Path to the definition of the object to be selected.<br>For example `/qNxGroupDef` . |
| [NxGroupDef](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Engine.NxGroupDef.htm) | groupDef | Definition of the new group. |
| System.String | targetGroupId | Id of the group to create the new subgroup in (if not the called object). |

### Returns

| Type | Description |
| --- | --- |
| System.String |  |

### Implements

[IGenericObject.CreateGroup(String, NxGroupDef, String)](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IGenericObject.CreateGroup.htm#Qlik_Engine_IGenericObject_CreateGroup_System_String_Qlik_Engine_NxGroupDef_System_String_)