CNContainer.Type
----------------

Queries type of container.

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

MBS( "CNContainer.Type"; ContainerIdentifier ) 

**MBS**( **"CNContainer.Type";** /\* Queries type of 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 type or error.

### Description

Queries type of container.  
Type can be Unassigned, Local, Exchange or CardDAV.  
### Examples

Queries container types:

 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](CNContainerName.md)"; id);   
 type = MBS ( "CNContainer.Type"; id);   
 names = names &amp; name &amp; " -&gt; " &amp; type &amp; ¶;   
 index = index + 1   
\] ;   
// return all the names  
names )  
<small>  
Example result:   
Mac.com -&gt; CardDAV  
Auf meinem Mac -&gt; Local</small>### See also

- [CNContactStore.Containers](CNContactStoreContainers.md)
- [CNContainer.Name](CNContainerName.md)

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

  
[CNContainer.Name](CNContainerName.md) - [CNGroup.Name](CNGroupName.md)

[HTML Version](CNContainerType.shtml)