# Value from JSON extract

**URL:** https://discourse.nodered.org/t/value-from-json-extract/82196
**Category:** General
**Created:** [19 October 2023 18:58 UTC](https://discourse.nodered.org/t/value-from-json-extract/82196 "2023-10-19T18:58:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Herbert](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Herbert](https://discourse.nodered.org/u/Herbert)
#### Post date: [19 October 2023 18:58 UTC](https://discourse.nodered.org/t/value-from-json-extract/82196/1 "2023-10-19T18:58:32Z")

</div>

Hello,

sorry for the question, this topic were similar as exist topics in forum, but they didn´t fit for me.

I have different Cron objects with ever 2 values and I need the extract object A as number. Example A with value (number) 20 in october.

Can somebody help me please.  
Thanks

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/d/3d5b7e4acacc7ac3c42f1cb7f55daf31888adced.png)

```auto
[
    {
        "id": "1a08b1a47399bbfe",
        "type": "cronplus",
        "z": "203feb89db46103a",
        "name": "Oct",
        "outputField": "payload",
        "timeZone": "",
        "persistDynamic": false,
        "commandResponseMsgOutput": "output1",
        "outputs": 1,
        "options": [
            {
                "name": "schedule1",
                "topic": "Value",
                "payloadType": "json",
                "payload": "{\"A\":20,\"B\":25}",
                "expressionType": "cron",
                "expression": "0 * * * OCT *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 970,
        "y": 1240,
        "wires": [
            [
                "f0e9c52bb2bfc324"
            ]
        ]
    },
    {
        "id": "f0e9c52bb2bfc324",
        "type": "change",
        "z": "203feb89db46103a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "limits",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1210,
        "y": 1200,
        "wires": [
            [
                "35264a76071e9c1f"
            ]
        ]
    },
    {
        "id": "35264a76071e9c1f",
        "type": "change",
        "z": "203feb89db46103a",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload.A",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1410,
        "y": 1200,
        "wires": [
            [
                "061259f520e53288"
            ]
        ]
    },
    {
        "id": "061259f520e53288",
        "type": "debug",
        "z": "203feb89db46103a",
        "name": "OUTPUT only value A in form of number",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1700,
        "y": 1200,
        "wires": []
    },
    {
        "id": "62e8ef35aa2f2783",
        "type": "cronplus",
        "z": "203feb89db46103a",
        "name": "Aug",
        "outputField": "payload",
        "timeZone": "",
        "persistDynamic": false,
        "commandResponseMsgOutput": "output1",
        "outputs": 1,
        "options": [
            {
                "name": "schedule1",
                "topic": "Value",
                "payloadType": "json",
                "payload": "{\"A\":8,\"B\":12}",
                "expressionType": "cron",
                "expression": "0 * * * AUG *",
                "location": "",
                "offset": "0",
                "solarType": "all",
                "solarEvents": "sunrise,sunset"
            }
        ],
        "x": 970,
        "y": 1180,
        "wires": [
            [
                "f0e9c52bb2bfc324"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [19 October 2023 19:08 UTC](https://discourse.nodered.org/t/value-from-json-extract/82196/2 "2023-10-19T19:08:09Z")

</div>

Hi @Herbert

Sorry - I can't quite decipher what you need.  
I don't use the `cronplus`, but I can see from the export it outputs a `payload` of (example)

```auto
{
  'A' :20,
  'B' :25
}

```

If you wanted that to become the below for the next Node...

```auto
{
  payload: 20
}

```

You need to switch around your `change` Node (you have it the other way)

![Screenshot 2023-10-19 at 20.04.18](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2b9aa50d4f0c8a33fe7418dcff9c569629a555c7.png)

Apologies if I have this wrong

---

<div class="post-metadata">

### Author: ![Herbert](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Herbert](https://discourse.nodered.org/u/Herbert)
#### Post date: [19 October 2023 19:12 UTC](https://discourse.nodered.org/t/value-from-json-extract/82196/3 "2023-10-19T19:12:45Z")

</div>

You were right.Thanks for your quick feedback.

🤗

I reed from the other topics it right, but I confised to write the correct text (payload.A) in right line.  
I didn´t find my mistake.

Again THANKS and have a NICE day 😉

---

<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: [2 November 2023 19:13 UTC](https://discourse.nodered.org/t/value-from-json-extract/82196/4 "2023-11-02T19:13:18Z")

</div>

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