Error with function

Can someone help to get this sorted out?

msg.payload= {
    "body": {
        "roomId": "Y2lzY29zcGFyazovL3VzL1JPT00vMmEzYzRjMDAtNTliOC0xMWU5LWEzZjktNGRjNmI1MmU3MTE3", "text": Network Device Details: '\n' Device 1: Host Name- "+host0+" , Management IP- "+host0IP+" , Reachability Status- "+host0S+"
    }
};

below screenshot list the errors i'm getting image

if you are posting code it is far easier to read if you format it, please follow the advice in this post: How to share code or flow json

The following is incorrect. Look at the quotes...

"text": Network Device Details: '\n' Device 1: Host Name- "+host0+" , Management IP- "+host0IP+" , Reachability Status- "+host0S+"

compared to...

"text": "Network Device Details: '\n' Device 1: Host Name- "+host0+" , Management IP- "+host0IP+" , Reachability Status- "+host0S+"

assuming host0 host 0IP and host0S are variables?

1 Like

yes they are variables,

var host0 = msg.payload.response[0].hostname;
var host0IP = msg.payload.response[0].managementIpAddress;
var host0S = msg.payload.response[0].reachabilityStatus;

Thanks a lot, i sorted that out