That is not enough info to help you.
Where do you see this?
What was the value of msg.payload
BEFORE the function node?
What was does the full msg
object look like AFTER the function node?
That is not enough info to help you.
Where do you see this?
What was the value of msg.payload
BEFORE the function node?
What was does the full msg
object look like AFTER the function node?
// **msg.payload before the function node**
var name = msg.payload;
name = name[0]["TEMPERATURE"];
msg.payload =name;
msg.payload = msg.payload.toString();
msg.topic = null;
return msg;
I have attached a screenshot which you can see the output.
Thank you in advance.
That is your function code - not the value of msg.payload
Put a debug BEFORE the function node, show us the value of msg.payload
before it enters the function
AND a debug AFTER the function node so we can see the FULL msg
object (set debug node to show complete message)
Ok, one last time
Add debug nodes like this...
... and give them all names (like "Debug Split Func", "debug request func", "debug http response")
Show use what you get out of all three debug nodes.
This is after the function node:
<str val="undefined" />
then the incoming payload is not correct. Do as I asked in previous post (add 3 debugs)
very odd.
2 things...
```
formatting)node.warn(["msg.payload", msg.payload, typeof msg.payload])
at the TOP of the "request_FromNiagra" function and try againshow use what you see in the debug sidebar.
// assign some variables
username = "obixUser";
password = "Wetec123456#@";
ipAddress = "172.30.34.212";
httpsPort = 443;
//create a base64 digest
authHash = Buffer.from(username+":"+password).toString("base64");
//ordSlot = "/Drivers/SysmikScaIoNetwork/AI4_2/points/Ai3/out/value";
ordSlot = "/Supply$20Fan/NewValue";
//ordSlot = "/Supply$20Fan/p";
// create the message for the get request
operation = "/set";
msg={
"method": "POST",
"url": "https://"+ipAddress+":"+httpsPort+"/obix/config"+ordSlot+operation,
"headers":{
"Authorization": "Basic" + authHash,
"Accept":"*/*"
}
};
//ignore cert expired error
msg.rejectUnauthorized = false;
//msg.payload = '<str val ="'+msg.payload+'"/>';
msg.payload = `<str val="${msg.payload}" />`;
return msg;
You still have an error because you DID NOT use the function code I wrote for you.
Thank you so much.
Now I got the results.
Thank you once again.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.