---
title: "ABPersonCreateSearchElement(_:_:_:_:_:)"
framework: addressbook
role: symbol
role_heading: Function
path: "addressbook/abpersoncreatesearchelement(_:_:_:_:_:)"
---

# ABPersonCreateSearchElement(_:_:_:_:_:)

Returns a search element object that specifies a query for records of this type.

## Declaration

```swift
func ABPersonCreateSearchElement(_ 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 Person Properties and Common Properties in ABRecord.
- `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.
- `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.
- `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 object that specifies a query according to the above parameters. You are responsible for releasing this object.

## Discussion

Discussion Use the ABAddressBook ABCopyArrayOfMatchingRecords(_:_:) function to actually perform the query. Also, see ABSearchElement C for more functions that create compound queries.

## See Also

### People

- [ABCopyArrayOfAllPeople(_:)](addressbook/abcopyarrayofallpeople(_:).md)
- [ABGetMe(_:)](addressbook/abgetme(_:).md)
- [ABPersonCopyImageData(_:)](addressbook/abpersoncopyimagedata(_:).md)
- [ABPersonCopyParentGroups(_:)](addressbook/abpersoncopyparentgroups(_:).md)
- [ABPersonCopyVCardRepresentation(_:)](addressbook/abpersoncopyvcardrepresentation(_:).md)
- [ABPersonCreate()](addressbook/abpersoncreate().md)
- [ABPersonCreateWithVCardRepresentation(_:)](addressbook/abpersoncreatewithvcardrepresentation(_:).md)
- [ABPersonSetImageData(_:_:_:)](addressbook/abpersonsetimagedata(_:_:).md)
- [ABSetMe(_:_:)](addressbook/absetme(_:_:).md)
