# Received JSON string at Notehub not in same order?

**URL:** <https://discuss.blues.com/t/received-json-string-at-notehub-not-in-same-order/2815>\
**Category:** Notecard API\
**Created:** [February 7, 2025, 5:24am UTC](https://discuss.blues.com/t/received-json-string-at-notehub-not-in-same-order/2815 "2025-02-07T05:24:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtrobregado](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@mtrobregado](https://discuss.blues.com/u/mtrobregado)\
**Post date:** [February 7, 2025, 5:24am UTC](https://discuss.blues.com/t/received-json-string-at-notehub-not-in-same-order/2815/1 "2025-02-07T05:24:06Z")

</div>

Hi,

I send this JSON string at Notecard WiFi v1. The sensor data is in this order temp, humid, light, batt, rssi.

```auto
const char testnote2[200] = "{"
                               "\"req\": \"note.add\","
                               "\"file\": \"sensor.qo\","
                               "\"sync\": true,"
                               "\"body\": {"
                                "\"temp\":20.5,"
                                "\"humid\":45,"
                                "\"light\":60,"
                                "\"batt\":3300,"
                                "\"rssi\":88"
                               "}}\n";

```

This is the JSON string I received at Notehub.

“file”: “sensor.qo”,  
“body”: {  
“batt”: 3300,  
“humid”: 45,  
“light”: 60,  
“rssi”: 88,  
“temp”: 20.5  
},

Why is the received JSON string not in the correct order?

Regards,  
Markel

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [February 7, 2025, 2:31pm UTC](https://discuss.blues.com/t/received-json-string-at-notehub-not-in-same-order/2815/2 "2025-02-07T14:31:15Z")

</div>

Hi @mtrobregado,

Due to the way Notehub processes inbound events, there is no guarantee on the order of fields in the resulting JSON. We always recommend processing events by field name and not by the expected location of the field.

Rob

---

<div class="post-metadata">

**Author:** ![JakeVdub](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@JakeVdub](https://discuss.blues.com/u/JakeVdub)\
**Post date:** [February 8, 2025, 7:29pm UTC](https://discuss.blues.com/t/received-json-string-at-notehub-not-in-same-order/2815/3 "2025-02-08T19:29:57Z")

</div>

According to [RFC 4627](https://www.ietf.org/rfc/rfc4627.txt) (the JSON RFC), a JSON object is “an unordered collection of zero of more name/value pairs”. Because a JSON object is not required to keep the same ordering, you shouldn’t expect to find the same ordering when you read it compared to when you sent it. It is best to validate and access your JSON data by the field name.
