CNContact.Name
--------------

Queries display name of contact.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Contacts](component_Contacts.md) | [8.4](newinversion84.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "CNContact.Name"; ContactIdentifier ) 

**MBS**( **"CNContact.Name";** /\* Queries display name of contact. \*/  
**$ContactIdentifier**) /\* The contact identifier.e.g. "46B1E34D-58F9-4B6B-A80D-0F71ABB87A0E" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ContactIdentifier | The contact identifier. | "46B1E34D-58F9-4B6B-A80D-0F71ABB87A0E" |

### Result

Returns name or error.

### Description

Queries display name of contact.  
### Examples

Query your name:

 MBS ( "CNContact.Name"; MBS ( "[CNContactStore.UnifiedMeContact](CNContactStoreUnifiedMeContact.md)" ))  
Query name of first contact found with given name:

 MBS ("CNContact.Name"; GetValue ( MBS ( "[CNContactStore.ContactsMatchingName](CNContactStoreContactsMatchingName.md)"; "Joe Miller" ); 1))  
Query names for all contacts:

 While(   
\[   
 names = "";   
 // query list of contact IDs  
 list = MBS ( "[CNContactStore.Contacts](CNContactStoreContacts.md)"; 1 );   
 count = ValueCount(list);   
 index = 1  
\] ;   
 index ≤ count ;   
\[   
 id = GetValue(list; index);   
 // query name for each ID  
 name = MBS ( "CNContact.Name"; id);   
 names = names &amp; name &amp; ¶;   
 index = index + 1   
\] ;   
// return all the names  
names )  
### See also

- [CNContact.JSON](CNContactJSON.md)
- [CNContact.Show](CNContactShow.md)
- [CNContact.Value](CNContactValue.md)
- [CNContactStore.Contacts](CNContactStoreContacts.md)
- [CNContactStore.ContactsMatchingEmailAddress](CNContactStoreContactsMatchingEmailAddress.md)
- [CNContactStore.ContactsMatchingName](CNContactStoreContactsMatchingName.md)
- [CNContactStore.ContactsMatchingURL](CNContactStoreContactsMatchingURL.md)
- [CNContactStore.FetchContact](CNContactStoreFetchContact.md)
- [CNContactStore.UnifiedMeContact](CNContactStoreUnifiedMeContact.md)
- [CNContainer.Name](CNContainerName.md)

### Release notes

- **Version 10.2**
    - Fixed a problem with [CNContact.Name](https://www.mbsplugins.eu/CNContactName.shtml) function and non fetched keys.

### Example Databases

- [Mac and iOS/Contacts/Contacts to FileMaker](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Contacts/Contacts%20to%20FileMaker.shtml#1ScriptAnchor_)
- [Mac and iOS/Contacts/ContactsChanged](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Contacts/ContactsChanged.shtml#2ScriptAnchor_)

### Blog Entries

- [New in MBS FileMaker Plugin 12.0](https://www.mbsplugins.de/archive/2022-01-31/New_in_MBS_FileMaker_Plugin_12/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.2pr7](https://www.mbsplugins.de/archive/2020-05-07/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

Created 1st August 2018 , last changed 14th June 2022

  
[CNContact.MailingAddress](CNContactMailingAddress.md) - [CNContact.SetValue](CNContactSetValue.md)

[HTML Version](CNContactName.shtml)