Hi -
I am trying to use a flow variable in a Node Red - Function that will send the data as a payload to a POST Http request.
I am querying one API and then saving the values for key data to flow variables, then using another product API to upload the data.
This is a copy of the function I have built, but the SleepScore Variable is not working in the downstream API, what do i have wrong?? When I use a static 2.5 values as in the others it works
const SleepScore = flow.get("SleepScore");
var outputMessage = {
_msgid: msg._msgid,
payload: {
"parent": { "database_id": "185--------------------080c" },
"icon": {
"emoji": "š„¬"
},
"properties": {
"Name": {
"title": [
{
"text": {
"content": "Title Goes Here"
}
}
]
},
"Sleep": { "number": SleepScore },
"Activity": { "number": 2.5 } ,
"Readiness": { "number": 2.5 }, }
}
}
return outputMessage;