Init Global array and flush it

Hi,
I'm searching how create a global empty array with name 'sources'
afterward I will fill it to have a array such as this one

sources
0 : "Name": "thierry"
    "Num": 3
1 : "Name": "search"
    "Num": 1
2 : "Name": "solution"
    "Num": 7
...

my problems

  • create empty array
  • to be able to empty it to obtain 0 elements

Thanks for your help

[
    {
        "id": "84a107a6183c6531",
        "type": "inject",
        "z": "7b9f1dda6e01a77d",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[]",
        "payloadType": "json",
        "x": 830,
        "y": 1580,
        "wires": [
            [
                "f8ed539f67f09dc7"
            ]
        ]
    },
    {
        "id": "f8ed539f67f09dc7",
        "type": "change",
        "z": "7b9f1dda6e01a77d",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "sources",
                "pt": "global",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1040,
        "y": 1580,
        "wires": [
            []
        ]
    }
]

Perfect !
Thanks Mickym2

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