I have a timelog table where my employees enter their working time.
employeeID
starttime
enddtime
duration
date
23
10:00
12:00
2
15.09.2022
23
13:00
17:00
4
15.09.2022
34
08:00
12:00
4
15.09.2022
34
13:00
17:00
4
15.09.2022
Is it possible to create a scheduled (every evening) bot that sends a mail to all the employees that have a value less than 8 in the combined duration column of the date of today?
With the example of the table, the employee with the ID 23 would get a mail, as he has only logged in 6 hours total, and the employee 34 doesn’t get a mail. The employee with the ID 18 also gets a mail, because he hasn’t logged a row at this date.
So I got this to work and send a mail to my account with all the employees that fulfill this condition. For each employee there is one mail sent, resulting in lots of mails.
Two questions:
Is it possible to just send a list of these employees (rows) to my mail and not a mail for each row?
Is it possible to send each of those employees (rows) a mail, but only to them and not others?
2 = Yes. I’d suggest you create an Employee table, link each timesheet to this table with a Ref column, then you can run a Bot on each row of the Employee table
I just looked into your solution for my second question.
I already have an employee table that is linked to the timesheet table. Are you proposing that I use the method from @TeeSee1 's first post? With the formula, I can trigger for each row in the employee table, that fulfill the condition. But how can I do it, that it sends the mail to the mail in these rows?
E.g.
Adrian should receive an mail (as he has only 6 hours logged in) and Peter shouldn’t receive a mail (as he has 8 hours logged in). Every row in the employee table, that fulfills the condition, should receive an mail.
I recently talked about how to do something similar to this in a live stream
here’s the clip:
This example is based on a form submit - but there’s elements in there that might be helpful
The things I’d do:
Create a slice that holds “the users that need an email”
Run an email task over that slice on a schedule - instead of triggering it, and doing all the file lookup stuff (you can likely ignore most of that), based on an interaction from a user
I could make it work with @TeeSee1 's solution, but I will save your video (and your channel) for future use. Thanks for all the content you are providing. Helps a ton.