Email script trigger help

Thanks, that initialChange boolean will help me filter some.

I am thinking that I might set a query tag up to read the top row, and if the initialChange bit is false, then compare to a memory tag, send the email if no match, then write to the tag.

If there is no change, or the initialChange bit is true, then I won't send an email.
I am a little concerned I might miss a change though in that case.

I could look at the timestamp, and email when it changes.


At the end of a shift, if they did great then I insert a new row.
I am to send an email to a manager, so they know.
I could look at just the timestamp or the whole row.


Well I have many machines, it probably is even more complex.
But maybe it makes it simpler.
Maybe I just set a timestamp of when I last sent an email, and send an email of any times since the last timestamp.

Do I create a table of sent events, and compare my list to that?
I am kind of thinking maybe that is easier, but also maybe silly.
I can't tell if I am over thinking it or it is an ideal usage for tables.


I think I will do two table, checked periodically.

SELECT table1.*
FROM table1
LEFT JOIN table2 ON table1.key_column = table2.key_column
WHERE table2.key_column IS NULL;

I also plan to use code from here, to pack the data up into a csv to email.
Export dataset to CSV and send as email attachment - #8 by jmacascas]