Convert data string to json

Hello,

Via an http API I receive a response in payload an string:

summary.Channel=0↵summary.EnteredSubtotal.Hour=0↵summary.EnteredSubtotal.Today=54↵summary.EnteredSubtotal.Total=119↵summary.EnteredSubtotal.TotalInTimeSection=54↵summary.ExitedSubtotal.Hour=0↵summary.ExitedSubtotal.Today=47↵summary.ExitedSubtotal.Total=114↵summary.ExitedSubtotal.TotalInTimeSection=47↵summary.InsideSubtotal.Total=0↵summary.RuleName=NumberStat↵summary.UTC=1685642403

But this is not exploitable. Why convert this an Json message ?

Thanks

The low code way would be as below, everything after template node.
How to import a flow

[{"id":"6197fde55e0e3097","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":3840,"wires":[["ef94ed694d00a32f"]]},{"id":"ef94ed694d00a32f","type":"template","z":"b9860b4b9de8c8da","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"summary.Channel=0\nsummary.EnteredSubtotal.Hour=0\nsummary.EnteredSubtotal.Today=54\nsummary.EnteredSubtotal.Total=119\nsummary.EnteredSubtotal.TotalInTimeSection=54\nsummary.ExitedSubtotal.Hour=0\nsummary.ExitedSubtotal.Today=47\nsummary.ExitedSubtotal.Total=114\nsummary.ExitedSubtotal.TotalInTimeSection=47\nsummary.InsideSubtotal.Total=0\nsummary.RuleName=NumberStat\nsummary.UTC=1685642403","output":"str","x":300,"y":3840,"wires":[["6661a58ea8caf583"]]},{"id":"6661a58ea8caf583","type":"csv","z":"b9860b4b9de8c8da","name":"","sep":"=","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"key,value","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":430,"y":3840,"wires":[["968cb24db98962f7","18ea408b8e2458ec"]]},{"id":"968cb24db98962f7","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"parts.type","pt":"msg","to":"object","tot":"str"},{"t":"set","p":"parts.key","pt":"msg","to":"payload.key","tot":"msg"},{"t":"change","p":"parts.key","pt":"msg","from":".","fromt":"str","to":"_","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":3840,"wires":[["32bc122e5d6425fb","18ea408b8e2458ec"]]},{"id":"18ea408b8e2458ec","type":"debug","z":"b9860b4b9de8c8da","name":"parts","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"parts","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":3880,"wires":[]},{"id":"32bc122e5d6425fb","type":"join","z":"b9860b4b9de8c8da","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":750,"y":3840,"wires":[["9ceeefcdef477eda"]]},{"id":"9ceeefcdef477eda","type":"debug","z":"b9860b4b9de8c8da","name":"debug 306","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":3980,"wires":[]}]

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