#ProjectOnline and adaptive cards in #MicrosoftTeams using #MicrosoftFlow for Project Owner actions #PPM #ProjectManagement #MSProject #Office365 #PowerPlatform
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) |
In my previous blog post I created an example of how a combination of Microsoft Teams, Adaptive Cards and Microsoft Flow can be used for project escalations by posting a card into a Microsoft Team for the PMO. In this post I’ve got a slightly different example that posts a card to a Project Owner to escalate to the project owner to action. For those that didn’t see my previous post, here is the link: https://pwmather.wordpress.com/2019/08/18/projectonline-and-adaptive-cards-in-microsoftteams-using-microsoftflow-for-project-escalations-ppm-projectmanagement-msproject-office365/
This example will post to the project owner when the project hasn’t been updated for the given period of time but the logic could easily be updated to another type of check. This has similar logic to the Flow I published last month: https://pwmather.wordpress.com/2019/07/31/projectonline-custom-email-notifications-using-msflow-microsoftflow-ppm-pmot-msproject-exchange-office365-powerplatform-planner-part-3/
Like in the previous adaptive card post, I used https://adaptivecards.io/designer/ to design this simple card, this time it’s slightly simpler for this example:
There are a few more actions in the Flow compared to the previous adaptive card example as this runs on a schedule and we need to perform an extra call to get the Project Owners email address. Here is the Flow overview:
The trigger is based on a schedule, in this example it is running weekly as this example checks which projects have not be published in that time. Then the Flow uses the Get past time action to get the date in the past, for this example it’s 5 days ago. These steps can be seen below:
The next action is a SharePoint HTTP action to query the ProjectData API in Project Online to get all projects that have not been published in 5 days using the get past time value and also where the projects are not 100 completed:
The logic can be changed by updating the OData query in the Uri property if you wanted to get projects based on other criteria. Next the Flow uses an apply to each action as the previous action could return more than one project, the output from the previous action is used for the input:
Within the apply to each action the Flow then uses another SharePoint HTTP action to query the ProjectServer API (note: not ProjectData so the account used in the connections will need access to all projects + the reporting OData API) to get the Project Owner details for the current project by passing in the ProjectId using the expression items(‘Apply_to_each’)[‘ProjectId’]:
Now the Flow has all the data to post the adaptive card to the project owner using the JSON payload as seen in the action below. This is posted to the project owner using the expression body(‘GetProjectOwnerDetails’)[‘Email’]. There are some dynamic values passed into the JSON too for the ProjectName items(‘Apply_to_each’)[‘ProjectName’] and the ProjectId items(‘Apply_to_each’)[‘ProjectId’]:
We also set the advanced options on this action to alert the user in Teams:
When the Flow runs this will post to the project owner in Microsoft Teams, on my test Project Online instance I’m the owner for all the test projects so this posted to my Teams client. The alerts are displayed as seen below:
Cards are posted to the project owners Flow chat too as seen below for the projects I own that need updating:
The owner can then easily click the access project button to go and update the project/s as required.
Another simple low / no code option for integrating Office 365 Project Online and Microsoft Teams using Microsoft Flow.