@MarkH1972 first thing I need you to do is delete your SharePoint List column that you named "1 week before start date".
Primarily you need to delete it due to the name you used. If you look into a post I made about SharePoint Column EntityPropertyName you will see that the name "1 week before start date" will be problematic in Power Automate because it starts with a number. The name you will have to use in power automate is probably something like odata__x0031_weekbeforestartdate and that will be annoying to reference.
Make sure you create the new column with no spaces in the name to prevent encoding. You can rename it afterwards and the internal name will stay the same.
I'm going to create an example using a column named "ProvisioningStartDate" which will be the week/date that the provisioning for a new employee should begin.
(You could just use a "StartDate" column and subtract 7 days; however, to respect your current process, I'm going to use the 1 week before start date example.)
- Trigger - Schedule Recurrence
- You set this for the days you want the flow to run. It will need to run on any day that could be a ProvisioningStartDate. If a ProvisioningStartDate is on a Wednesday and the flow only ran once a week on Monday, that item would be skipped. If all your ProvisioningStartDate will be a Monday then you can run the flow once a week on Mondays.
- Get Items - SharePoint
- This uses the Filter Query in the Advanced Parameters. You need to put the column name equals the current date. See the reference Get Items Example for more info.
- Apply to Each - For Each
- Will perform actions on each item returned by Get Items. If you have 12 employees with the same ProvisioningStartDate then the Apply to Each will go 12 times and send 12 emails.
- Compose
- This holds the StartDate dynamic content. This is only needed because the email body has difficulty adding dynamic content. So putting the date in this Compose, and then using the outputs of this in the email body is easier.
- Send an Email (V2)
- This will be the email sent to whomever you have the address.
Filter Query expression:
ProvisioningStartDate eq 'utcNow('yyyy-MM-dd')'
Here are the screenshots below:
List View of Items with employee start dates
Flow Trigger is a Recurrence Schedule
Get Items uses a Filter Query on the column ProvisioningStartDate eq 'utcNow('yyyy-MM-dd')'
This compose is used to hold the startdate to put into the email body. This is due to difficulty getting the dynamic content into the email body.
Send an Email uses the outputs of the Compose in the body for the StartDate
Email Output Example
I hope this example gets you in the right direction.
If you wanted to use the StartDate column instead of the ProvisioningStartDate, you just need to adjust the Get Items advanced parameter Filter Query. It will use the StartDate column and then add 7 days to the current date.
So basically, "If today's date added 7 days is equal to the StartDate then get the item."
StartDate eq 'addDays(utcNow(),int(7),'yyyy-MM-dd')
Here is a screenshot example:
Filter Query using the StartDate eq 'addDays(utcNow(),int(7),'yyyy-MM-dd')