# Get Values From Json ${resp\_json()}

**URL:** <https://forum.robotframework.org/t/get-values-from-json-resp-json/7095>\
**Category:** Robot Framework\
**Created:** [29 March 2024 10:57 UTC](https://forum.robotframework.org/t/get-values-from-json-resp-json/7095 "2024-03-29T10:57:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slashlinux](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/slashlinux/32/3563_2.png) [@slashlinux](https://forum.robotframework.org/u/slashlinux)\
**Post date:** [29 March 2024 10:57 UTC](https://forum.robotframework.org/t/get-values-from-json-resp-json/7095/1 "2024-03-29T10:57:55Z")

</div>

**How can I get values from the key “createdAt” and “deviceid” and validate it in keyword?**

```
{
    "content": [
        {
            "id": "23424564-a3423ae-324-2342-234324234",
            "version": 18,
            "createdAt": 1711459466029,
            "createdBy": "device",
            "modifiedAt": 1711705613758,
            "modifiedBy": "device2",
            "formattedCreatedAt": "2024-03-26T13:24:26.029Z",
            "deviceid": "test-device01",

}
]
}

```

**I tried like that but … not working**

```
${list_items} = Create List test-device01
${json_data} = Get Value From Json ${resp.json()} $..createdAt['1711459466029'] $..deviceid['test-device01']
 List Should Contain Sub List ${json_data} ${list_items}

```

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [29 March 2024 14:06 UTC](https://forum.robotframework.org/t/get-values-from-json-resp-json/7095/2 "2024-03-29T14:06:23Z")

</div>

Is `${resp}` the data returned from a requests library keyword?

If so `${resp.json()}` is not a `json_object` but rather the method `.json()` converts the json string to a python dictionary.

Based on the JSON you showed you could do something like this:

```python
${createdAt}= Set Variable ${resp.json()}[content][0][createdAt]
${deviceid}= Set Variable ${resp.json()}[content][0][deviceid]

```

Dave.

---

<div class="post-metadata">

**Author:** ![slashlinux](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/slashlinux/32/3563_2.png) [@slashlinux](https://forum.robotframework.org/u/slashlinux)\
**Post date:** [2 April 2024 12:56 UTC](https://forum.robotframework.org/t/get-values-from-json-resp-json/7095/3 "2024-04-02T12:56:14Z")

</div>

Thank you so much Dave

---

<div class="post-metadata">

**Author:** ![jacob-nekrassov](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/jacob-nekrassov/32/5128_2.png) [@jacob-nekrassov](https://forum.robotframework.org/u/jacob-nekrassov)\
**Post date:** [1 June 2026 13:48 UTC](https://forum.robotframework.org/t/get-values-from-json-resp-json/7095/4 "2026-06-01T13:48:11Z")

</div>

Thank you very much Dave, that saved my day
