---
title: "ABGroupCreateSearchElement(_:_:_:_:_:)"
framework: addressbook
role: symbol
role_heading: Function
path: "addressbook/abgroupcreatesearchelement(_:_:_:_:_:)"
---

# ABGroupCreateSearchElement(_:_:_:_:_:)

Creates an ABSearchElement object that specifies a queryfor ABGroup records.

## Declaration

```swift
func ABGroupCreateSearchElement(_ property: CFString!, _ label: CFString!, _ key: CFString!, _ value: CFTypeRef!, _ comparison: ABSearchComparison) -> Unmanaged<ABSearchElementRef>!
```

## Parameters

- `property`: The name of the property to search on. It cannot be NULL. For a full list of the properties, see Group Properties and Common Properties.
- `label`: The label name for a multi-value list. If property does not have multiple values, pass NULL. If property does have multiple values, pass NULL to search all the values. By default, ABGroup records don’t contain any multi-value list properties.
- `key`: The key name for a dictionary. If property is not a dictionary, pass NULL. If property is a dictionary, pass NULL to search all keys. By default, ABGroup records don’t contain any properties that are dictionaries.
- `value`: The value you are searching for. It cannot be NULL
- `comparison`: Specifies the type of comparison to perform, such as doc://com.apple.addressbook/documentation/AddressBook/kABEqual or doc://com.apple.addressbook/documentation/AddressBook/kABPrefixMatchCaseInsensitive. For a full list, see doc://com.apple.addressbook/documentation/AddressBook/ABSearchComparison.

## Return Value

Return Value A search element objectthat specifies a query according to the above parameters. You areresponsible for releasing this object.

## Discussion

Discussion Use the ABAddressBook ABCopyArrayOfMatchingRecords(_:_:) functionto actually perform the query. Also, see ABSearchElement C formore functions that create compound queries.

## See Also

### Groups

- [ABCopyArrayOfAllGroups(_:)](addressbook/abcopyarrayofallgroups(_:).md)
- [ABGroupAddGroup(_:_:)](addressbook/abgroupaddgroup(_:_:).md)
- [ABGroupAddMember(_:_:_:)](addressbook/abgroupaddmember(_:_:).md)
- [ABGroupCopyArrayOfAllMembers(_:)](addressbook/abgroupcopyarrayofallmembers(_:).md)
- [ABGroupCopyArrayOfAllSubgroups(_:)](addressbook/abgroupcopyarrayofallsubgroups(_:).md)
- [ABGroupCopyDistributionIdentifier(_:_:_:)](addressbook/abgroupcopydistributionidentifier(_:_:_:).md)
- [ABGroupCopyParentGroups(_:)](addressbook/abgroupcopyparentgroups(_:).md)
- [ABGroupCreate()](addressbook/abgroupcreate().md)
- [ABGroupRemoveGroup(_:_:)](addressbook/abgroupremovegroup(_:_:).md)
- [ABGroupRemoveMember(_:_:_:)](addressbook/abgroupremovemember(_:_:).md)
- [ABGroupSetDistributionIdentifier(_:_:_:_:)](addressbook/abgroupsetdistributionidentifier(_:_:_:_:).md)
