# API How to retrieve state field value

**URL:** <https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500>\
**Category:** Get Help\
**Created:** [August 29, 2025, 4:56pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500 "2025-08-29T16:56:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![myg\_ge](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/myg_ge/32/12457_2.png) [@myg\_ge](https://community.fibery.io/u/myg_ge)\
**Post date:** [August 29, 2025, 4:56pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/1 "2025-08-29T16:56:44Z")

</div>

Hey guys, how do I properly retrieve the state field value?

My query:

```auto
[{ "command": "fibery.entity/query", 
  "args": { 
    "query": {
      "q/from": "CRM/Person Email Activity",
      "q/select": [
        "fibery/id",
        "fibery/public-id", 
        "CRM/UUID", 
        "workflow/state"
      ],
      "q/where": ["=", ["CRM/UUID"], "$message_id"],
      "q/limit": 1
    },
    "params":{
      "$message_id": "d9a1f3b2-4c7e-4a6f-9b2d-3c8e1f0a5b6c"
    }
  } 
}]

```

produces an error:

```auto

{
"success": 
false,
"result": 
{
"name": 
"entity.error/query-primitive-field-expr-invalid",
"message": 
"Invalid field expression, field: \"workflow/state\" field is not primitive.",
"data": 
{
"top": 
{
"error/name": 
"entity.error/query-primitive-field-expr-invalid",
"field": 
[
"workflow/state"
]
},
"cause": 
{
"error/name": 
"entity.error/query-primitive-field-expr-invalid",
"field": 
[
"workflow/state"
]
},
"field": 
[
"workflow/state"
]
}
}
}
]

```

Thank you.

---

<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:** [August 29, 2025, 7:03pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/2 "2025-08-29T19:03:05Z")

</div>

The state field is just an example of a [select field](https://the.fibery.io/@public/User_Guide/Guide/Entity-API-264/anchor=Select-Fields--e01360bf-8926-4edb-b725-f1a4148aa8ce)

---

<div class="post-metadata">

**Author:** ![myg\_ge](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/myg_ge/32/12457_2.png) [@myg\_ge](https://community.fibery.io/u/myg_ge)\
**Post date:** [August 29, 2025, 8:02pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/3 "2025-08-29T20:02:02Z")

</div>

Sorry Chris. It’s unclear what you wanted to say.

---

<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:** [August 29, 2025, 8:50pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/4 "2025-08-29T20:50:05Z")

</div>

The workflow field is not a ‘primitive’ field where you query its value, so you need to specify which property - typically its name - that you wish to return. Check out the guide I linked to, and this [other topic](https://community.fibery.io/t/accessing-workflow-via-api/1390).

---

<div class="post-metadata">

**Author:** ![myg\_ge](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/myg_ge/32/12457_2.png) [@myg\_ge](https://community.fibery.io/u/myg_ge)\
**Post date:** [August 30, 2025, 6:07am UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/5 "2025-08-30T06:07:59Z")

</div>

Awesome. Exactly what I needed. Strangely I hadn’t found that earlier. Thanks for your help Chris!

---

<div class="post-metadata">

**Author:** ![myg\_ge](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/myg_ge/32/12457_2.png) [@myg\_ge](https://community.fibery.io/u/myg_ge)\
**Post date:** [August 30, 2025, 7:23pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/6 "2025-08-30T19:23:35Z")

</div>

Fibery AI is such a time saver especially when it comes to creating API queries.

---

<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:** [August 31, 2025, 8:58pm UTC](https://community.fibery.io/t/api-how-to-retrieve-state-field-value/9500/7 "2025-08-31T20:58:33Z")

</div>


