Switch node for strange payload

Hi,

Trying to figure out how i can filter an exact part of a payload. The payload comes from an HTTP source, as follows:

{“mac”:“cxxxxxxxx”,“content”:“Call Log(Door Bell Call)”}

MAC address blurred intentionally.

In nodered, this is an object. I want to only allow the “content”:“Call Log(Door Bell Call)”

I have tried various function nodes, and switch nodes, for example payload.content and then “call log(door bell call)” as the switch output with no success.

Any ideas?

Thanks.

Use JSONata expression, which must evaluate to ‘true’ for the switch path to be followed.

Expression looks for “Bell” (or whatever) in the field payload.content and returns ‘true’ if found, false if not.

1 Like

Thanks. This worked!