I got a phonebook record list from my Fritzbox router with the following structure:
[{
"category": "0",
"person": {
"realName": "Joe Blow"
},
"uniqueid": "507",
"telephony": {
"services": {
"email": {
"_": "some@mail.com",
"$": {
"classifier": ""
}
}
},
"number": {
"_": "0123456",
"$": {
"type": "mobile",
"vanity": "",
"prio": "1"
}
}
}
},
...
I got a function node defined to search for a specific number but it might be more simple with one JSONata expresion like:
*[telephony.number._ = "0123456" ]
which gives me one matching record to process further.
This works fine with a test setup and the fixed number in the JSONata Expression. But of course I want to inject any number in the change node to test for. However injecting a phone number in msg.topic with an a JSONata expression like:
*[telephony.number._ = $lookup(msg.topic) ]
does not work? Whats wrong with my syntax?