<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/ODRecordSetValue(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Open Directory"
    ],
    "preciseIdentifier" : "c:@F@ODRecordSetValue"
  },
  "title" : "ODRecordSetValue(_:_:_:_:)"
}
-->

# ODRecordSetValue(_:_:_:_:)

Sets one or more attribute values of a record.

```
func ODRecordSetValue(_ record: ODRecordRef!, _ attribute: String!, _ valueOrValues: CFTypeRef!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool
```

## Parameters

`record`

The record.

`attribute`

The attribute type to set.

`valueOrValues`

The value or values. Can be of type `CFStringRef` or `CFDataRef`, or a `CFArrayRef` containing elements of type `CFStringRef` and `CFDataRef`.

`error`

An error reference for error details. Can be `NULL`.

## Return Value

`true` if the value or values are successfully set; otherwise, `false`.

## Discussion

Passing an empty array for `inValueOrValues` deletes the attribute.

## See Also

[General Attribute Types](/documentation/OpenDirectory/general-attribute-types)

Types of Open Directory attributes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)