Monitor SQL Dataset And Notify When New Rows Added
Every 5 Minutes, checks if new rows are added to a specific SQL data set.
If there are new rows added - sends an email with all the new values in one of the columns from the new rows (The user can specify from which column the email text will be prepared)
1. In the "SQL Connections" App, a SQL Connection bot needs to be created named "My Database1"
2. After installing the solution in Easybots Studio, press "Validate & Create Missing Bots.." to automatically create the other missing bots used in the solution.
3. Enter the missing inputs in the solution:
- 3.1 SQL SELECT statement
- 3.2 Column Name from which the email text to be prepared with the newly added rows
- 3.3 email address of the recipient
Example SQL SELECT statement, to get newly registered users in ASP MVC web app:
SELECT [Id], [Email] FROM [dbo].[AspNetUsers]
The SQL Select statement should have DISTINCT row values in order for the comparison to work correctly (Due to the spec in the 'DataTables Utilities.Compare' action)
If there can be duplicate rows, but you still want to get notified about the new duplicate rows added, then add:
'ROW_NUMBER() OVER (ORDER BY CAST(GETDATE() AS TIMESTAMP))' to your SQL SELECT statement.
SELECT ROW_NUMBER() OVER (ORDER BY CAST(GETDATE() AS TIMESTAMP)), [Email] FROM [dbo].[AspNetUsers]