# Fail to enumerate linked documents in entity

**URL:** <https://community.fibery.io/t/fail-to-enumerate-linked-documents-in-entity/8776>\
**Category:** Get Help\
**Created:** [May 12, 2025, 9:17pm UTC](https://community.fibery.io/t/fail-to-enumerate-linked-documents-in-entity/8776 "2025-05-12T21:17:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geire](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/geire/32/6091_2.png) [@geire](https://community.fibery.io/u/geire)\
**Post date:** [May 12, 2025, 9:17pm UTC](https://community.fibery.io/t/fail-to-enumerate-linked-documents-in-entity/8776/1 "2025-05-12T21:17:12Z")

</div>

Hi,  
I’m trying to access the documents field in a database. The plan is to generate a summary of all the linked documents in the entity. However, when I try to access the Documents field I get an error saying: “Failed to execute Action “Script”: getEntityById: There is no relation for “My space/Database 1” database “documents/documents” field.” Below is the code I’m using to access the Documents field in the current entity. Any tips?

```auto
const fibery = context.getService('fibery');
for (const entity of args.currentEntities) {
    
    const docEntity = await fibery.getEntityById(entity.type, entity.id, ['Documents']);

}

```
