Addressbook.recordsMatchingSearchElement
----------------------------------------

Searches matching records.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Addressbook](component_Addressbook.md) | [5.4](newinversion54.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md). Use [Contacts](component_Contacts.md) functions instead.

MBS( "Addressbook.recordsMatchingSearchElement"; SearchElement ) 

**MBS**( **"Addressbook.recordsMatchingSearchElement";** /\* Searches matching records. \*/  
**$SearchElement**) /\* The ID for the search element. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| SearchElement | The ID for the search element. | $SearchElement |

### Result

Returns list or error.

### Description

Searches matching records.  
Returns a list of records that match the given search element, or returns an empty array if no records match the search element.  
### Examples

Find a person with first name being Christian:

 Set Variable \[$e1 ; Value:MBS ( "[Addressbook.searchElementForProperty](AddressbooksearchElementForProperty.md)"; "person"; "FirstNameProperty"; ""; ""; "Christian"; "Equal" )\]  
Set Variable \[$records ; Value:MBS ( "Addressbook.recordsMatchingSearchElement"; $e1 )\]  
Set Variable \[$record ; Value:GetValue($records ; 1)\]  
Set Variable \[$name ; Value:MBS ( "[Addressbook.record.displayname](Addressbookrecorddisplayname.md)"; $record )\]  
Show Custom Dialog \[$name \]  
Search people with related name being John:

 Set Variable \[$e1 ; Value:MBS ( "[Addressbook.searchElementForProperty](AddressbooksearchElementForProperty.md)"; "person"; "RelatedNamesProperty"; ""; ""; "John"; "ContainsSubStringCaseInsensitive" )\]  
Set Variable \[$records ; Value:MBS ( "Addressbook.recordsMatchingSearchElement"; $e1 )\]  
Set Variable \[$record ; Value:GetValue($records ; 1)\]  
Set Variable \[$name ; Value:MBS ( "[Addressbook.record.displayname](Addressbookrecorddisplayname.md)"; $record )\]  
Show Custom Dialog \[$name \]  
### See also

- [Addressbook.record.displayname](Addressbookrecorddisplayname.md)
- [Addressbook.searchElementForConjunction](AddressbooksearchElementForConjunction.md)
- [Addressbook.searchElementForProperty](AddressbooksearchElementForProperty.md)

### Blog Entries

- [MBS FileMaker Plugin, version 5.4pr4](https://www.mbsplugins.de/archive/2015-10-29/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 26th October 2015 , last changed 26th October 2015

  
[Addressbook.record.valueForProperty](AddressbookrecordvalueForProperty.md) - [Addressbook.removeRecord](AddressbookremoveRecord.md)

[HTML Version](AddressbookrecordsMatchingSearchElement.shtml)