Connection with database error

No, where it says *** Property, change it from msg.payload to msg.topic

No. Change the Property field at the top to say topic rather than payload, and leave the Template as you had it before:

SELECT rfidno FROM rfid1 
WHERE rfidno='{{payload}}';

ok Done ,Now Tell

Great, so now run your flow with a good RFID and a bad RFID and show the results.

What to write in switch node and change node


like this i have to write .Sorry For troubling ,but as i am new I dont have idea.

You may have missed where I suggested:

I then recommend you add a Debug node after the mysql node so you can see exactly what it is returning. That will help you/us identify how to configure the Switch node to test if the query found a match or not.

Until we can see what the mysql node is returning for both a 'good' result and a 'bad' result, we can't tell you how to configure the Switch node.

d dd sure check this ones

Now run with a bad RFID and show the results

g

Now add this change node after the mysql node and it will output one side of the output for a good RFID and the other for a bad RFID.

[{"id":"513c017d.be004","type":"switch","z":"4fe1dfa2.29df78","name":"","property":"payload","propertyType":"msg","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"false","repair":false,"outputs":2,"x":610,"y":240,"wires":[["50ab302f.1c6958"],["2c15b7c7.468878"]]}]

gh
like this.now what to write in change node

now what next .please help

Have you imported the Switch node that @zenofmud gave you?

Switch node i have drag and drop in my node red

No. He gave you a piece of JSON in his last reply. Copy that JSON, then import it into the editor. That will give you a switch node that is configured to separate out the good and bad messages.

Did you import the change node I provided in my last post? If not, please import it and remove the change node you created.

@zenofmud to avoid confusion, it's a Switch node you have provided, not a Change node.

1 Like

ya i have done it shows a switch node poped up

i changed the "switch" to "change" in json object