The idea is to store the last received information in a TinyDB. When you open the app again, the information received by the data changed event is compared to the TinyDB: if it is different then it will execute some actions, if it’s equal then it will not do anything. You seem to be doing this on the blocks in the left (NotifyDB), but you need to do the same with the blocks on the right (StockDB).
Another question is: do you have several tags stored in the NotifyDB or just one tag? If you have several, all of the tags are received sequentially when you open the app, so the event Data Changed is called several times and you’re TinyDB is overwritten several times and just the last tag remains stored, which means that you will still receive the notifications from the other tags. If you have a fixed number of tags (like just Stocks, Purchases and Dispatch), you can put the TinyDB blocks inside the “if” blocks that identifies which tag you are receiving and compare each one individually.
I’m sorry if I’m not very clear to understand, English is not my first language.