#ProjectOnline custom #email notifications using #MSFlow #MicrosoftFlow #PPM #PMOT #MSProject #Exchange #Office365 #PowerPlatform Part 2
I am a Project Server and SharePoint consultant but my main focus currently is around Project Server.
I have been working with Project Server for nearly five years since 2007 for a Microsoft Gold Certified Partner in the UK, I have also been awared with the Microsoft Community Contributor Award 2011. I am also a certified Prince2 Practitioner. This article has been cross posted from pwmather.wordpress.com (original article) |
Following on from my last post on email notifications using Microsoft Flow, this post looks at further examples. Part 1 can be found here: https://pwmather.wordpress.com/2019/03/18/projectonline-custom-email-notifications-using-msflow-microsoftflow-ppm-pmot-msproject-exchange-office365-powerplatform-part-1/
In case you missed it, I also published a video last week with a simple example Flow to send the project owner an email on project creation: https://youtu.be/CCdxUqBrhEA
In part 2 we will look another example email notification to email each resource the projects they are assigned to for the coming week. The Flow can be seen below:
This is triggered on schedule as seen below, update as needed:
The Flow then gets some date time values using the Date Time actions for the current date time and a future date time:
The Flow then fires off an HTTP request to SharePoint to get a list of resources with email addresses from the Project Online Odata Reporting API:
Then using an Apply to each action we send an email to the assigned resources. Firstly we pass in the output from the previous step, which is:
body(‘GetAllResourcesWithEmailAddresses’)[‘value’]
Then inside the loop we perform another HTTP call to SharePoint, this time to get the resource’s assignments for the week by querying the Project Online Odata Reporting API as seen below:
Here we are passing in 3 variables to the Odata query:
- ResourceId which is the following expression added in: items(‘Apply_to_each’)[‘ResourceId’]
- Current time and Future time to filter the data returned from the time phased resource demand endpoint to this week, these are the outputs from the previous date time actions:
The Flow then creates an HTML table from the data returned from the previous action:
body(‘GetAllResourceAssignments’)[‘value’]
Then the final action in the Flow is to send an email:
The To value is an expression: items(‘Apply_to_each’)[‘ResourceEmailAddress’]
Update the email body as needed and include the output from Create HTML table action.
This will result in an email being sent to all resources in Project Online with email addresses containing their weekly assignments detailing the projects that they are working on, here is an example email:
Another example that demonstrates how easily custom email notifications can be created for Project Online using Microsoft Flow.