CNContainer.Name
----------------

The name of the container.

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

MBS( "CNContainer.Name"; ContainerIdentifier ) 

**MBS**( **"CNContainer.Name";** /\* The name of the container. \*/  
**$ContainerIdentifier**) /\* The identifier for the container.e.g. "9892A5CC-964E-497A-B877-A47619F7493C:ABAccount" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ContainerIdentifier | The identifier for the container. | "9892A5CC-964E-497A-B877-A47619F7493C:ABAccount" |

### Result

Returns name or error.

### Description

The name of the container.  
The container is the source of contacts, e.g. an account on iCloud.  
### Examples

Query names of containers:

 While(   
\[   
 names = "";   
 // query list of container IDs  
 list = MBS ( "[CNContactStore.Containers](CNContactStoreContainers.md)" );   
 count = ValueCount(list);   
 index = 1  
\] ;   
 index ≤ count ;   
\[   
 id = GetValue(list; index);   
 // query name for each ID  
 name = MBS ( "CNContainer.Name"; id);   
 names = names &amp; id &amp; " -&gt; " &amp;name &amp; ¶;   
 index = index + 1   
\] ;   
// return all the names  
names )  
<small>  
Example result:   
9892A5CC-964E-497A-1234-A47619F7493C:ABAccount -&gt; Mac.com  
\_local:ABAccount -&gt; On my Mac</small>### See also

- [CNContact.Name](CNContactName.md)
- [CNContactStore.Containers](CNContactStoreContainers.md)
- [CNContainer.Type](CNContainerType.md)

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

  
[CNContactStore.UpdateContact](CNContactStoreUpdateContact.md) - [CNContainer.Type](CNContainerType.md)

[HTML Version](CNContainerName.shtml)