Whenever there is now ID in MySQL show it to msg.debug

Hi guys,

And again I can't find proper solution for my scenario.
I have succesfully established connection between node-red and MySQL , SELECT is working flawlessly, but I can't mind how to receive msg.debug whenever there is new INSERT into MySQL table.
Each input has unique ID, so is it even possible to gather information as I want?
For example:
User A filled quiz which produced new ID in MySQL, when it happens node-red msg.debug says: 'hey , new entry with #ID' This checker can be time triggered , for example 2mins.

Cheers! :slight_smile:

Presumably it's not Node-Red that manages the INSERT, or you could use that flow to notify you of a new record.

Something like this should work.
Maybe this query is more efficient - "select id from table_name order by id desc limit 1"

1 Like

I need to receive msg.payload notification only when new ID is created in MySQL! If ID, for example #ID4583 is the same, check it after 10mins again! If #ID4584 , msg.payload should notify me .
Is it possible?

Yes it is.

Can you help me to write this function?

This is the way I'd do it. The third node is a Filter.


Does it not work for you?

When i try to select , all seems to be working just fine!
image

But when i use select max(id) im getting middle finger!
image
hmmmm... strange

Got it!
Thanks mate, my problem is solved!
Have a nice day!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.