# fibery.getEntityById - If fields are not passed, all 1st level fields will be returned?

**URL:** <https://community.fibery.io/t/fibery-getentitybyid-if-fields-are-not-passed-all-1st-level-fields-will-be-returned/2666>\
**Category:** API & Programming\
**Created:** [March 29, 2022, 12:38am UTC](https://community.fibery.io/t/fibery-getentitybyid-if-fields-are-not-passed-all-1st-level-fields-will-be-returned/2666 "2022-03-29T00:38:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [March 29, 2022, 12:38am UTC](https://community.fibery.io/t/fibery-getentitybyid-if-fields-are-not-passed-all-1st-level-fields-will-be-returned/2666/1 "2022-03-29T00:38:26Z")

</div>

I might be missing something but how does one get all 1st level fields via `fibery.getEntityById`?

When I try something like this:

```auto
await fibery.getEntityById(entity.type, entity.id, [])

```

I only get something like this:

`{ Id: '913ab0a0-a17e-11ac-abcd-645c978db1234' }`

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/3/3a8645a55e80557f728c655415cf0002330c6083.png)

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [March 29, 2022, 3:12pm UTC](https://community.fibery.io/t/fibery-getentitybyid-if-fields-are-not-passed-all-1st-level-fields-will-be-returned/2666/2 "2022-03-29T15:12:25Z")

</div>

Hello.  
Yeah, description of this function is not true, I’ve fixed that.

Here is a sample of code that does what you need. You can filter some fields by some criteria.

```auto
const schema = await fibery.getSchema();
const fields = schema.typeObjectsByName[entity.type].fieldObjects.map(fieldObject => fieldObject.title);
const entityWithExtraFields = await fibery.getEntityById(entity.type, entity.id, fields);

```
