Basically I'm trying to send a phone number into nodered (this works) then get node-red to perform a lookup in a table stored somewhere (CSV?) and return a name for the caller. Getting nowhere. Have been Googling two evenings on the trot. If anyone knows how I should be doing this I'd be very grateful! Thanks
[
{
"id": "17688172.d2304f",
"type": "tab",
"label": "Woo woo",
"disabled": false,
"info": ""
},
{
"id": "c56ba5eb.e35668",
"type": "mqtt in",
"z": "17688172.d2304f",
"name": "",
"topic": "calls/in/01302628441",
"qos": "2",
"datatype": "auto",
"broker": "34ac2466.a0f64c",
"x": 170,
"y": 160,
"wires": [
[
"53847812.e80058"
]
]
},
{
"id": "53847812.e80058",
"type": "function",
"z": "17688172.d2304f",
"name": "",
"func": "\nvar loc = {\n\n'01209793193':'Jen',\n\n'67890':'Location 2',\n\n'abcde':'Location 3'\n\n};\n\nmsg.payload.location = loc[msg.payload.id];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 370,
"y": 200,
"wires": [
[
"f5bef78b.e23848"
]
]
},
{
"id": "f5bef78b.e23848",
"type": "debug",
"z": "17688172.d2304f",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 570,
"y": 180,
"wires": []
},
{
"id": "34ac2466.a0f64c",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "192.168.1.110",
"port": "1883",
"clientid": "node-red",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
}
]