Parsing JSON to text

I have built a flow and was able to get required JSON data to show up in a table. But i am unable to store the values without the html in a text file. Please give some pointers on how to proceed.

[
    {
        "id": "047f00710ef832ec",
        "type": "tab",
        "label": "GoDaddy_Appraisal",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "9f49e25acb9211bc",
        "type": "ui_template",
        "z": "047f00710ef832ec",
        "group": "0c1a8b2d5075e125",
        "name": "user input validate",
        "order": 1,
        "width": "0",
        "height": "0",
        "format": "<md-input-container  style=\"text-align:center;overflow:hidden;\">\n    <span> \n    <input ng-model=\"user.input\" placeholder={{msg.topic}}>\n    <br>\n    <button class=\"bluebutton\" ng-click=\"msg.payload = user.input; send(msg)\" ng-keypress=\"($event.charCode==13)?msg.payload = user.input; send(msg)\" ngstyle=\"{background-color: #008CBA;}\" style=\"color: #fff;background-color: #5bc0de; border-color: #46b8da;\">Send</button></span>\n</md-input-container>\n    ",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "resendOnRefresh": false,
        "templateScope": "local",
        "className": "",
        "x": 310,
        "y": 260,
        "wires": [
            [
                "20bc5eb2a0160c7e"
            ]
        ]
    },
    {
        "id": "1029599aa3b23193",
        "type": "inject",
        "z": "047f00710ef832ec",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "",
        "topic": "DomainName",
        "payload": "DomainName",
        "payloadType": "str",
        "x": 220,
        "y": 180,
        "wires": [
            [
                "9f49e25acb9211bc",
                "e183b29a36758801"
            ]
        ]
    },
    {
        "id": "20bc5eb2a0160c7e",
        "type": "http request",
        "z": "047f00710ef832ec",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "body",
        "url": "https://api.godaddy.com/v1/appraisal/{{payload}}",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "senderr": false,
        "x": 350,
        "y": 320,
        "wires": [
            [
                "7f9961248abaf77c"
            ]
        ]
    },
    {
        "id": "8c5a3d6cd7d3115f",
        "type": "debug",
        "z": "047f00710ef832ec",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 380,
        "wires": []
    },
    {
        "id": "7f9961248abaf77c",
        "type": "json",
        "z": "047f00710ef832ec",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 410,
        "y": 380,
        "wires": [
            [
                "8c5a3d6cd7d3115f",
                "1277cbbb9ad187d8",
                "e8e2955bf98a85ab"
            ]
        ]
    },
    {
        "id": "1277cbbb9ad187d8",
        "type": "ui_template",
        "z": "047f00710ef832ec",
        "group": "0c1a8b2d5075e125",
        "name": "Table",
        "order": 2,
        "width": 0,
        "height": 0,
        "format": "<h1>Appraisal Data</h1>\n<table border=\"1\">\n        <tr>\n            <th>Domain</th>\n            <th>Price</th>\n            <th>Year</th>\n        </tr>\n        <tr ng-repeat=\"(k,v) in msg.payload.comparable_sales\">\n            <td>{{v.domain}}</td>\n            <td>{{v.price}}</td>\n            <td>{{v.year}}</td>\n        </tr>\n    </table>\n",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 610,
        "y": 440,
        "wires": [
            []
        ]
    },
    {
        "id": "e8e2955bf98a85ab",
        "type": "json-2-csv",
        "z": "047f00710ef832ec",
        "name": "",
        "x": 660,
        "y": 340,
        "wires": [
            []
        ]
    },
    {
        "id": "e183b29a36758801",
        "type": "file",
        "z": "047f00710ef832ec",
        "name": "",
        "filename": "D:\\nodejs\\nodered\\data.html",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "false",
        "encoding": "none",
        "x": 900,
        "y": 180,
        "wires": [
            []
        ]
    },
    {
        "id": "0c1a8b2d5075e125",
        "type": "ui_group",
        "name": "Appraisal",
        "tab": "d0a7efb21da49074",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "d0a7efb21da49074",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

As you have not really provided any details (like what part of the response you wish to save to file) I have knocked up a working demo that you can play with...

[{"id":"1029599aa3b23193","type":"inject","z":"047f00710ef832ec","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"DomainName","payload":"test.co.uk","payloadType":"str","x":360,"y":260,"wires":[["20bc5eb2a0160c7e"]]},{"id":"20bc5eb2a0160c7e","type":"http request","z":"047f00710ef832ec","name":"","method":"GET","ret":"obj","paytoqs":"body","url":"https://api.godaddy.com/v1/appraisal/{{payload}}","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":350,"y":320,"wires":[["8c5a3d6cd7d3115f","0a63679c17b484e1"]]},{"id":"8c5a3d6cd7d3115f","type":"debug","z":"047f00710ef832ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":350,"y":380,"wires":[]},{"id":"0a63679c17b484e1","type":"change","z":"047f00710ef832ec","name":"copy comparable_sales to payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.comparable_sales","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":320,"wires":[["1664ae4ce592f0f4"]]},{"id":"1664ae4ce592f0f4","type":"csv","z":"047f00710ef832ec","name":"","sep":",","hdrin":"","hdrout":"all","multi":"one","ret":"\\n","temp":"domain,price,year","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":570,"y":380,"wires":[["613587795b7bc8a6","29fe449942a74bf5"]]},{"id":"613587795b7bc8a6","type":"file","z":"047f00710ef832ec","name":"","filename":"c:\\temp\\data.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":760,"y":380,"wires":[[]]},{"id":"29fe449942a74bf5","type":"debug","z":"047f00710ef832ec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":420,"wires":[]}]

Hello @Steve-Mcl ,
Yes, I needed the comparable_sales part only to be parsed as text and saved to the file. Thank you for the solution. Will use it and learn.
Regards,
Ravi Kumar

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