# How to GET ALL context data & value in array object?

**URL:** <https://discourse.nodered.org/t/how-to-get-all-context-data-value-in-array-object/67366>\
**Category:** General\
**Tags:** function-node\
**Created:** [6 September 2022 01:58 UTC](https://discourse.nodered.org/t/how-to-get-all-context-data-value-in-array-object/67366 "2022-09-06T01:58:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yusuv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yusuv/32/7626_2.png) [@yusuv](https://discourse.nodered.org/u/yusuv)\
**Post date:** [6 September 2022 01:58 UTC](https://discourse.nodered.org/t/how-to-get-all-context-data-value-in-array-object/67366/1 "2022-09-06T01:58:04Z")

</div>

Hello everyone, how to get all context key and data value. in one variable array object?

since

**\> context.keys()**

only returns all context keys, I want the data value too.

---

<div class="post-metadata">

**Author:** ![yusuv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yusuv/32/7626_2.png) [@yusuv](https://discourse.nodered.org/u/yusuv)\
**Post date:** [6 September 2022 02:35 UTC](https://discourse.nodered.org/t/how-to-get-all-context-data-value-in-array-object/67366/2 "2022-09-06T02:35:46Z")

</div>

Sorry everyone i have found the solution..

```auto
[
    {
        "id": "b76b82eb9f1905bf",
        "type": "inject",
        "z": "107aae492a2a8ba7",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 360,
        "y": 1520,
        "wires": [
            [
                "9af809098a246a3b"
            ]
        ]
    },
    {
        "id": "9af809098a246a3b",
        "type": "function",
        "z": "107aae492a2a8ba7",
        "name": "",
        "func": "context.set(\"A\",[{\"A\":1,\"B\":2}])\ncontext.set(\"B\",[{\"A\":1,\"B\":2}])\ncontext.set(\"C\",[{\"A\":1,\"B\":2}])\ncontext.set(\"D\",[{\"A\":1,\"B\":2}])\n\nvar data = context.keys()\n\nmsg.payload = context.get(data)\n\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 1520,
        "wires": [
            [
                "58292cc55f49a2bd"
            ]
        ]
    },
    {
        "id": "58292cc55f49a2bd",
        "type": "debug",
        "z": "107aae492a2a8ba7",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 850,
        "y": 1520,
        "wires": []
    }
]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 September 2022 02:36 UTC](https://discourse.nodered.org/t/how-to-get-all-context-data-value-in-array-object/67366/3 "2022-09-20T02:36:10Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
