# API select query on state or description field does not work

**URL:** <https://community.fibery.io/t/api-select-query-on-state-or-description-field-does-not-work/3069>\
**Category:** Get Help\
**Created:** [July 13, 2022, 2:59pm UTC](https://community.fibery.io/t/api-select-query-on-state-or-description-field-does-not-work/3069 "2022-07-13T14:59:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 13, 2022, 3:18pm UTC](https://community.fibery.io/t/api-select-query-on-state-or-description-field-does-not-work/3069/3 "2022-07-13T15:18:37Z")

</div>

FYI, here’s a useful script to get all the fields of a given entity. It might help you figure out the correct names to use.

> [@Getting all field values for an entity](https://community.fibery.io/t/getting-all-field-values-for-an-entity/2801):
>
> Here’s a little scripting snippet for how to retrieve all the information about an entity, without knowing or hard-coding the space name, database name or field names: const fibery = context.getService('fibery'); // get entire schema const schema = await fibery.getSchema(); // get specific database (type) name const typeName = args.currentEntities[0].type; // filter the schema for the specific type and get all field names const fields = schema['typeObjects'].filter((obj) =\> obj.name == typeName…

---

_[View the full topic](https://community.fibery.io/t/api-select-query-on-state-or-description-field-does-not-work/3069)._
