I am not a coder but I challenge myself. I am attempting to select only a specific value from a payload.
this is my payload:
{
"applicationId": "61ac43d686ea5501fd13a215",
"applicationName": "Sigfox callback",
"data": {
"body": {
"{ \"device\" : \"2058EE\", \"time\" : \"1638684238\", \"data\" : \"5af3107a1d47\", \"seqNumber\" : \"48\" }": ""
},
"headers": {
"accept-charset": "UTF-8;q=0.9,*;q=0.7",
"accept-encoding": "gzip,deflate",
"accept-language": "fr",
"content-length": "150",
"content-type": "application/x-www-form-urlencoded",
"user-agent": "SIGFOX",
"x-forwarded-for": "185.110.98.5",
"x-forwarded-proto": "https",
"x-real-ip": "185.110.98.5"
},
"method": "post",
"path": "/",
"query": {
},
"replyId": "61ac441b09119443483690b9.ncLGvXeJe5koM4xW7skVg.uacZ7klp0W6vpw_EOygbgW"
},
"flowId": "61ac47e18c09256f92188669",
"flowName": "Sigfox1",
"flowVersion": "develop",
"globals": {
},
"relayId": "000000000000000000000000",
"relayType": "public",
"time": "2021-12-05T06:05:10.491Z",
"triggerId": "61ac441b09119443483690b9",
"triggerType": "webhook"
}
I am trying to select and output only the value "data"in the body.
I have tried with a function on this way:
payload = payload.data.body.data
but I am not coming right. I can output the entire string “body”: {
“{ “device” : “2058EE”, “time” : “1638762361”, “data” : “5af3107a1d47”, “seqNumber” : “61” }”: “”
}
payload = payload.data.body
return payload;
But I am battling to get only the string data in body.
How can I extract only the value in data?
Thanks for helping