Addressbook.group.addMember
---------------------------

Adds a person to a group.

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

### Deprecated

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

MBS( "Addressbook.group.addMember"; GroupID; PersonID ) 

**MBS**( **"Addressbook.group.addMember";** /\* Adds a person to a group. \*/  
**$GroupID**; /\* The unique ID for the target group. \*/   
**$PersonID**) /\* The unique ID for the person to be added to the group. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| GroupID | The unique ID for the target group. | $groupID |
| PersonID | The unique ID for the person to be added to the group. | $personID |

### Result

Returns 1 for success or 0 for failure on Mac. Returns OK on success and error on failure on iOS.

### Description

Adds a person to a group.  
If the person argument is already part of the group, this method does nothing and returns OK.   
Prior to OS X v10.6, if the person record is already in the group, this method does nothing and returns failure.  
### Examples

Add person to group:

 # add to group   
Set Variable \[ $r ; Value: MBS ( "Addressbook.group.addMember"; "Best Friends"; $PersonID ) \]   
\# save changes   
Set Variable \[ $r ; Value: MBS ( "[Addressbook.save](Addressbooksave.md)"; $personID ) \]  
### See also

- [Addressbook.group.addSubgroup](AddressbookgroupaddSubgroup.md)
- [Addressbook.group.members](Addressbookgroupmembers.md)
- [Addressbook.group.removeMember](AddressbookgroupremoveMember.md)
- [Addressbook.save](Addressbooksave.md)

This function checks for a license.

Created 18th August 2014 , last changed 6th November 2017

  
[Addressbook.formattedAddress](AddressbookformattedAddress.md) - [Addressbook.group.addSubgroup](AddressbookgroupaddSubgroup.md)

[HTML Version](AddressbookgroupaddMember.shtml)