Forum Discussion
Send Email to Email in List on Specific Date
Hey everyone! I am new to Power Automate and could use some assistance.
My goal is to automate an email sent to access card holders two weeks prior to the card expiration.
So far, I have a column setup for the correct date for the email to be sent and the recipient's email, but I am not sure how to automate the email on that date.
Any help would be much appreciated.
3 Replies
- Jon_LakeBrass Contributor
Hi CXPAirport, if you have a field named (for example) 'card_expiry_date' in your source data (SharePoint list, Excel workbook, etc.) then you could also use a calculated field to automatically calculate the date two weeks prior to expiry. Then, in Power Automate you can use a Get Items action with a filter query when the 'expiry_reminder_date' is equal to today, assuming that you want to the Flow to run automatically on a daily basis, which would be good practice.
Alternatively you could get all of the items in the source data (assuming there's not tens of thousands) and filter where the expiry date field equals the expression 'addToTime(utcNow(),2,'Week','yyyy-MM-dd')'. That expression calculates a date two weeks from now. You would need to adjust the date format to match your source data field.Following the filter you would add a 'send an email (v2)' action, which will natively drop into an 'apply to each' condition and loop through each record returned.
- CXPAirportCopper ContributorJon_Lake Thank you for the response, this looks like it will work.
The only thing missing is how do I tell the 'send an email (V2)' action to select the corresponding email to the 'expiry_reminder_date' in the list as the recipient?- Jon_LakeBrass Contributor
Hi CXPAirport , your source table/list must contain either an email address or username which allows the drawdown of profile data from Azure AD, which will contain (amongst other things) the user email address. If you're using a people lookup field it's a simple process of using the 'Get user profile' action. If you're relying on a free-text user name field it should match an element of the user profile in Azure AD. Once you have the email address from the 'Get user profile' action you can use the email address returned by it.