This blog post is inspired by the following Microsoft Tech Community conversation:
The user wants to send an email to users “assigned” to a document after it has been uploaded. In this demo I am using a standard document library with an additional site column called “AssignedTo”.
Within your Document Library, click “Flow” and select “See you flows”
Within Power Automate, click “New” and select “Automated – from blank”
Provide a Flow name, i.e. “Email assigned to”, select the SharePoint “When a file is created (properties only)” trigger and click “Create”
Point it to your site and document library
Add a “Condition” action and set “Value” to AssignedTo.DisplayName, condition is not equal to and choose a value to expression null
- This condition action will check for empty “AssignedTo”
Set the “Yes” branch to the “Send an email (V2)” action with AssignedTo.Email in the “To” field
Set the “No” branch to the “Send an email (V2)” action with CreatedBy.Email in the “To” field
Any time a document is uploaded to the site an email will be generated notifying the “AssignedTo” of the document or it will email the “Created by” that the “AssignedTo” site column is blank.
This is a simple Flow but it showcases condition and error checking that is paramount for production workloads.
Thanks for stopping by.