AquaLogic Interaction Development Kit (IDK) 6.0.0 |

# IContentItem.SetItemCollectionPropertyValue Method

Updates the value of the `IItemCollectionProperty`.

void SetItemCollectionPropertyValue(
IBaseProperty collectionProperty,
IContentItem[] contentItems
);

#### Parameters

collectionProperty
  The `IItemCollectionProperty`; cannot be `null`.
contentItems
  The new collection of content items; cannot be `null`.

#### Remarks

An `InvalidOperationException` will be thrown if this method is called on an item that is not checked out. The updated property value will not be persisted until `IContentItemManager.CheckInItem` is called. If the content item does not contain the specified property, an `ArgumentException` will be thrown when `IContentItemManager.CheckInItem` is called.

The code sample below shows how to retrieve an array of content items and set the value of an `IItemCollectionProperty` to the retrieved content items.

    // Set the IItemCollectionProperty value to an array of existing Content items,
    // assuming there are one or more content items in the specified folder.
    IContentItem[] items = contentItemManager.GetContentItems(folder);
    contentItemManager.CheckOutItem(contentItem);
    contentItem.SetItemCollectionPropertyValue(itemCollectionProperty, items);

    // Check-in the Content item to persist the updated Item Collection property value.
    contentItemManager.CheckInItem(contentItem, "Check-in the item with Item Collection Property value updated.");

    // Retrieves the value after the item is checked-in.
    IContentItem[] retrievedItemCollectionPropValue = contentItem.GetItemCollectionPropertyValue(itemCollectionProperty);

See the code sample in IContentItem for an example of how to modify a property value of different types.

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | The item has already been removed or the item is not checked out.
ArgumentException | The item does not contain the specified property.

#### See Also

IContentItem Interface | Plumtree.Remote.PRC.Content.Item Namespace | CheckInItem