> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblSocialManagerCreateSocialUserGroupFromFilters

> XblSocialManagerCreateSocialUserGroupFromFilters

# XblSocialManagerCreateSocialUserGroupFromFilters

Constructs a XblSocialManagerUserGroup, which is a collection of users with social information.

## Syntax

```cpp theme={null}
HRESULT XblSocialManagerCreateSocialUserGroupFromFilters(  
         XblUserHandle user,  
         XblPresenceFilter presenceFilter,  
         XblRelationshipFilter relationshipFilter,  
         XblSocialManagerUserGroupHandle* group  
)  
```

### Parameters

*user*   \_In\_\
Type: XblUserHandle

XBOX Live User the group is associated with.

*presenceFilter*   \_In\_\
Type: [XblPresenceFilter](/reference/live/xsapi-c/social_manager_c/enums/xblpresencefilter)

The restriction of users based on their presence and title activity.

*relationshipFilter*   \_In\_\
Type: [XblRelationshipFilter](/reference/live/xsapi-c/social_manager_c/enums/xblrelationshipfilter)

The restriction of users based on their relationship to the calling user.

*group*   \_Outptr\_result\_maybenull\_\
Type: [XblSocialManagerUserGroupHandle\*](/reference/live/xsapi-c/social_manager_c/handles/xblsocialmanagerusergrouphandle)

Passes back a handle to the created group. This group can be later be cleaned up with XblSocialManagerDestroySocialUserGroup. The group will also be cleaned up (invalidating the returned handle) if the associated user is removed from Social Manager.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

The result of a user group being loaded will be triggered through the [XblSocialManagerEventType](/reference/live/xsapi-c/social_manager_c/enums/xblsocialmanagereventtype)::SocialUserGroupLoaded event in [XblSocialManagerDoWork](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerdowork).

## Requirements

**Header:** social\_manager\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[social\_manager\_c](/reference/live/xsapi-c/social_manager_c/social_manager_c_members)


## Related topics

- [XblSocialManagerUserGroupGetFilters](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerusergroupgetfilters.md)
- [Social Manager overview](/services/xbox-services/community/social-manager/live-social-manager-overview.md)
- [XblSocialManagerDestroySocialUserGroup](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerdestroysocialusergroup.md)
- [XblSocialManagerUserGroupGetUsersTrackedByGroup](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerusergroupgetuserstrackedbygroup.md)
- [XblSocialManagerUpdateSocialUserGroup](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerupdatesocialusergroup.md)
