There is a meeting that occurs every week, but has a rotating list of members. So one person from each department goes one week, and the next week it is a different person from each department, and so on.
Right now I have 2 SharePoint lists set up, one for the current week’s schedule (which has a column for each department, and one name in each column), and another that has the complete list of names (where each column is a department, and in those columns are the names of the people in that department).
I have JavaScript on the page with the current week’s schedule that runs when the page loads. This does a few things.
Checks if the current schedule is out of date (it’s an if statement that will evaluate true every Monday morning.)
- If the current schedule is out of date, then it takes the names in the current (now outdated) schedule, finds them in the second list which contains all the names, gets the next name for each department, and updates the list items in the current schedule with the new names. This is all done using the SharePoint REST API (it makes AJAX calls for creating and deleting list items)
- This ends the “if” statement, and the rest of the code runs as usual
If schedule is up to date, it then takes the names in the current schedule and looks them up in the second list with all the names. It then populates a table that goes 14 weeks into the future with what the schedule will be for each week.
What I need to do now is to have the system send an email every Monday morning to the people who have to attend the meeting that week. I thought maybe I could use a SharePoint workflow to send the email, but I ran into a problem. I can set up a workflow to email the names in the list just fine, and have it wait and do it every Monday morning. But the problem is that the list itself only updates when the page is loaded, since all the code for the updating is JavaScript which can only be run when the page is loaded. So if the page isn’t loaded on Monday, then the list won’t get updated, and it will email the old people. If someone manually loads the page before the email would be sent, then everything would work fine. Right now I am trying to figure out the best way to automatically update the list (without having someone visit the page every week) and then send the email.