> For the complete documentation index, see [llms.txt](https://brixxbox.gitbook.io/brixxbox-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brixxbox.gitbook.io/brixxbox-documentation/client-api-reference/functions/getattachmentsforcurrentrecord.md).

# getAttachmentsForCurrentRecord

Returns a list of all the attachments of the current record. The list is ordereb by id desc. so the newest documents will be the first you will find while iterating over the array.

### Example Usages

#### Example 1

```
   console.log(brixxApi.getAttachmentsForCurrentRecord());
```

#### Example 2 Filtering

```javascript
   let allAttachmentsForThisRecord = brixxApi.getAttachmentsForCurrentRecord();
   let invoices = allAttachmentsForThisRecord.filter(singleAttachment => {return singleAttachment.documentTypeId == 2}); //We assume, that there is just one invoice
   let attachmentBlob = brixxApi.getAttachmentById(invoices[0].id);
   brixxApi.printBlob(attachmentBlob)
```
