Hello,
I am using http request to get data of one month. Screenshots of what I am getting in debug is attached below which is array of objects. Now I want to access minvalue from the first object and maxvalue from last object. But I am unable to write the function node for it.
Please help me with this.
[{"id":"46b3ab03.36e904","type":"ui_button","z":"88215ed2.1446d","name":"","group":"ee1c959c.6ac4f8","order":0,"width":0,"singleBrowser":false,"height":0,"passthru":false,"label":"This Month","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","powerMode":false,"x":290,"y":760,"wires":[["4a655ce9.ac06d4"]]},{"id":"4a655ce9.ac06d4","type":"http request","z":"88215ed2.1446d","name":"","method":"GET","ret":"obj","url":"","timeout":"","mindspherePath":"/api/iottsaggregates/v4/aggregates?assetId=ded1a0bfec43400f970e566f8263c6d3&aspectName=BatchMix&from=2022-12-01T00:00:00.000Z&to=2022-12-07T00:00:00.000Z&intervalUnit=hour&intervalValue=12&select=Agg1_Current_Weight","useMindsphereAuth":true,"isAdmin":false,"secretHeaders":"","x":530,"y":760,"wires":[["dc97188a.f2fe58","aacbcb9e.ef42a8"]]},{"id":"aacbcb9e.ef42a8","type":"function","z":"88215ed2.1446d","name":"","func":"const agg1 = msg.payload[0];\nconst minvalue = agg1.Agg1_Total_Weight.minvalue;\n//const maxvalue = agg1.maxvalue;\n//const difference = maxvalue - minvalue;\nmsg.payload = minvalue;\nreturn msg;\n//return { payload: { minvalue, maxvalue, difference } };","outputs":1,"language":"javascript","noerr":0,"x":740,"y":760,"wires":[["b8e08189.44e68"]],"_type":"node"},{"id":"b8e08189.44e68","type":"ui_text","z":"88215ed2.1446d","group":"ee1c959c.6ac4f8","order":0,"width":0,"singleBrowser":false,"height":0,"name":"","label":"Agg1","format":"{{msg.payload}}","layout":"row-left","x":930,"y":760,"wires":[]},{"id":"dc97188a.f2fe58","type":"debug","z":"88215ed2.1446d","name":"","active":true,"console":"false","xaxis":"_time","complete":"false","x":630,"y":880,"wires":[]},{"id":"ee1c959c.6ac4f8","type":"ui_group","z":"","name":"This Month","tab":"975e5c7e.bc29e","order":4,"disp":true,"width":"6","collapse":false,"_type":"config"},{"id":"975e5c7e.bc29e","type":"ui_tab","z":"","name":"Test Plant","icon":"dashboard","publicAccess":"true","fmAccess":"none","fmAccessType":"private","assetType":"","asset":"","assetName":"","assetText":"","image":"","description":"","hideTitleBar":false,"_type":"config"}]