Home > Paul Mather, Work > Sync #MSProject #Roadmap Row Item Status with #ProjectOnline Task Status using #MicrosoftFlow #CDS #PowerPlatform #MSFlow #REST #SharePoint #WorkManagement #Office365

Sync #MSProject #Roadmap Row Item Status with #ProjectOnline Task Status using #MicrosoftFlow #CDS #PowerPlatform #MSFlow #REST #SharePoint #WorkManagement #Office365

Paul Mather
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)

At the recent Microsoft PPM Summit in Prague last week, Chris Boyd from the Microsoft Project Product team demonstrated syncing the Roadmap row item status with the task status from the Project Online schedule. This was done using compiled code in a console application which worked well. I set myself a little challenge to do something similar but all from Microsoft Flow. Being a public holiday here in the UK, I found an hour spare today to tackle this. In this blog post I walkthrough the Flow actions required to do this. A summary image can be seen below:

image

As you can see, this flow is triggered on a Project Online Project Publish. I then execute a REST query on the Project Data API using the send an HTTP request to SharePoint action:

image

I pass in the published project ID and select the TaskID and the custom field I’m using to set the Roadmap row item status. I created a custom field called “Roadmap Health” that was a lookup with the same status values as Roadmap but you can use any field and values, just update the query and Flow Switch action as needed.

I then create a new variable called “Health” and set the Type to an Integer:

image

I then add an Apply to each action and pass in the body(‘GetTaskHealth’)[‘value’] expression to use the output from my REST call:

image

I then have a condition check action to check for null values in the Roadmap Health field, the expression for the field is items(‘Apply_to_each’)[‘RoadmapHealth’] then null is also added via an expression:

image

You could remove the need for the condition check by filtering out the nulls in the REST call. If this is false, nothing happens as there is no status to sync, if this true the next action is a  Switch, the field I’m using in the switch is referenced using the expression: items(‘Apply_to_each’)[‘RoadmapHealth’]

image

Then for each possible value from the task level custom field you are using, map this to one of the Roadmap status’ by setting the Health variable, for example, when the Roadmap Health task field value is equal to “On Track” I set the variable to 0:

image

The Roadmap status enumerations are below:

  • On Track = 0
  • Potential Problem = 1
  • At Risk = 2
  • Complete = 10
  • Not Set = 100

Once that is completed for all possible outcomes, the next action is the List records Common Data Service action:

image

Here the Flow returns the Roadmap Item Link record for the TaskId passed in, the TaskId is referenced using the following expression: items(‘Apply_to_each’)[‘TaskId’]

The next action is another Apply to each action, Flow does this automatically as the List records would typically return more than one record:

image

The output used for this action is the default List records value from the Dynamic Content option. Then the final action within the Flow is the Common Data Service Update a record:

image

This action updates the Roadmap Items, I then pass in the List records Roadmap Item value from the Dynamic content panel, this is the Roadmap Item Id value. I also pass in the Health variable in the “Health Status Value” field. The flow will loop through all Project tasks and update the equivalent Roadmap row item status, pretty simple for a no / low code solution using only Microsoft Flow!

Over the next few days I will publish a short video for this Flow on my YouTube channel and also probably provide a download link for this Flow template to help as a solution starter.

Advertisement
Categories: Paul Mather, Work Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: