# attached-to (/catalog/edges/attached-to)

Makes an item part of another, such as a scan attached to the document it was made for, or a receipt attached to a task.



## attached-to [#attached-to]

Says that an item is attached to another item and exists for it, such as a scanned page attached to the document it was scanned for.

| Property | Kind | Description |
| - | - | - |
| `position` | `number` | Where the attachment comes among the item's attachments, such as the page number of a scan. |

An attachment lists what it's **Attached to**, and the item it belongs to lists its **Attachments**. Read from that item, the edge's reverse name is `has-attachment`. An item can be attached to any number of items, and `position` orders an item's attachments. [Edges](/build/edges#edge-types) says when to use it and when another edge type fits.

## In the bin [#in-the-bin]

An attachment is a **part**, and the items it's attached to are its **hosts**:

* It goes to the bin when its last host does, and comes back when any host comes back. It doesn't come back if you binned it on its own.
* It's purged with its last host.
* Removing the edge leaves both items where they are, and archiving a host changes nothing.

`part eq true` in a [filter](/build/list-filter-search) finds parts.

## In a folder [#in-a-folder]

A file can't hold frontmatter, so the document it's attached to writes the edge under the reverse name:

```yaml
has-attachment:
  - "[[receipt.pdf]]"
```

[Attach a file to a note](/use/work-with-folder-files#attach-a-file-to-a-note) covers attachments in a folder.

## Example [#example]

A receipt attached to a task, first among its attachments:

```json
{
  "edge_type": "attached-to",
  "from_id": "01a1f139-e006-7509-a3f6-a953e29cdf67",
  "to_id": "01a1f139-dff2-7c08-9f4e-5b6a7d8e9f10",
  "properties": { "position": 1 }
}
```
