# `GSElement propertyListToData:format:error:`

*Instance Method*

Appends a Glyphs source representation to a data buffer.

## Declaration

```swift
func propertyList(to data: CFMutableData, format formatVersion: GSFormatVersion) throws
```

```objc
- (BOOL) propertyListToData:(CFMutableDataRef) data format:(GSFormatVersion) formatVersion error:(NSError **) error;
```

```python
propertyListToData_format_error_(data: CFMutableDataRef, formatVersion: GSFormatVersion) -> tuple[bool, NSError]
```

## Parameters

- `data` — The data buffer to which the representation is appended.
- `formatVersion` — The Glyphs file format version used for the representation.
- `error` — On failure, an error describing why the representation could not be written.

## Return Value

Whether the representation was appended successfully.

## Discussion

Concrete subclasses implement this method for their representation.

## See Also

### Encoding

- [`GSElement setPropertyListValue:format:`](/Core/GlyphsCore/GSElement/setPropertyListValue:format:) — Restores the common element values from a Glyphs source representation.
- [`GSElement propertyListValueFormat:error:`](/Core/GlyphsCore/GSElement/propertyListValueFormat:error:) — A property-list representation of the common element values, or `nil` when all values have their defaults.

