#ProjectOnline Snapshot / data to #SharePoint list using #MSFLow #MicrosoftFlow #PPM #PMOT #Office365 #PowerPlatform

December 14, 2018 at 10:00 pm | Posted in Add-on, Administration, Configuration, Customisation, Functionality, Information, Reporting, Workflow | Leave a comment
Tags: , , , , , , , ,

Next in my series of posts on using Microsoft Flow with Project Online is capturing Project Online data into a SharePoint list, this is a useful scenario for simple snapshot requirements. For example, if you want to snapshot some key project level data, the easiest place to store this data is in a SharePoint list. I have blogged simple code examples before that do this: https://pwmather.wordpress.com/2016/08/26/projectonline-data-capture-snapshot-capability-with-powershell-sharepoint-office365-ppm-bi/ & https://pwmather.wordpress.com/2018/01/27/projectonline-project-level-html-fields-to-a-sharepoint-list-powershell-ppm-office365/ Whilst these approaches work, the PowerShell does need to be run from somewhere, a server / Azure Function etc. This post provides the same end result with Project Online data in a SharePoint list but all from a Microsoft Flow. The Flow can be seen below:

image

This simple example makes use of the recurrence trigger to schedule the process, the “Send an HTTP Request to SharePoint” action to get the project data from Project Online and a SharePoint create item action inside an Apply to each loop. We will walkthrough the actions later in the post.

Firstly, the SharePoint list was created:

image

This was created in my Project Online Project Web App site collection. I created SharePoint columns on this list for each of the fields I wanted to capture from my Project Online dataset. As this is just an example, the number of fields and data is quite limited. Now back to the Flow. We will skip over the recurrence trigger to the first action that gets the Project Online data, this just uses the “Send an HTTP Request to SharePoint” action to call the Project Online OData REST API so that we can easily get all of the Project Online data. In this example we are accessing the Projects endpoint in this API and selecting a few example project level fields including an example custom field:

image

This action will get all of the data based on the Odata query used in the Uri input. We wont cover all of the settings here in this post as I covered this in the last post found here: https://pwmather.wordpress.com/2018/12/12/projectonline-publish-all-projects-using-msflow-microsoftflow-ppm-pmot-office365-powerplatform-part-2/

Next we need to loop through all of the projects in the results array to create a SharePoint list item for each project. To do this we need to use an “Apply to each” action:

image

In the output from the previous step we use body(‘ReadallProjects’)[‘value’] to use the data from the previous step which is all of our Project Online projects with some data minus the timesheet project in this example. Then for each project in the array we create a list item on our target SharePoint list using the create item action. In the create item action we just map the data from the array to the correct list column. The Project Online fields are accessed using an expression, for example for ProjectCost in this example Flow the expression is items(‘Apply_to_each’)[‘ProjectCost’] where apply to each is the name of the action and ProjectCost is the field / property in the results from the Odata query.

Once this Flow runs a few times you can then easily create snapshot / trend reports or even extend the SharePoint view to show what you need:

image

As you can see in this example, I’ve updated the SharePoint view to show the RAG icon in the Overall RAG column rather than the text value. This is very simple with the column formatting options available with the SharePoint modern UI using JSON.

Another example of extending Project Online with low / no code solutions in Office 365.

There will be further example solutions built for Project Online using Microsoft Flow in later posts.

Advertisements

#ProjectOnline Publish all projects using #MSFLow #MicrosoftFlow #PPM #PMOT #Office365 #PowerPlatform part 2

December 12, 2018 at 9:00 pm | Posted in Administration, Configuration, Customisation, Functionality, Information, Workflow | 1 Comment
Tags: , , , , , , ,

Following on from my first blog post on Publishing all projects in Project Online using Microsoft Flow, here is the 2nd post. For those that missed the 1st part, it can be found here: https://pwmather.wordpress.com/2018/12/06/projectonline-publish-all-projects-using-msflow-microsoftflow-ppm-pmot-office365-powerplatform-part-1/

In this post we will look at achieving the same publish all functionality but using different actions than we used in the last example. Previously we used the actions available with the Project Online connector, in this example we do not use the Project Online connector when accessing Project Online. The Project Online connector actions used previously to get the projects, check the projects out and then publish and check in the projects have been replaced with a SharePoint action where we can call the Project Online REST APIs. This is to show another example of working with Project Online using Flow. This approach does require an understanding of the Project Online REST APIs but this approach offers so much more capability for Project Online when using Microsoft Flow. The Flow can be seen below:

image

The difference between this Publish all flow and the example from part 1 is that we have replaced all of the Project Online connector native actions with the SharePoint “Send an HTTP Request to SharePoint” action and removed the Filter action as that is not required now. The “Send an HTTP Request to SharePoint” action can be used to work with the Project Online REST CSOM API and the Odata Reporting API directly from Microsoft Flow – this opens up so many more options for working with Project Online using Flow! This Flow assumes you have set up the connection for SharePoint Online using an account that has publish access to all projects and access to the Odata Reporting API in Project Online. This example is still triggered using the schedule action so I wont cover that part. Once triggered, the first action is to get all of the Project Online projects:

image

Enter the Project Online PWA site URL in the Site Address, select the HTTP Method – GET in this case. Then add the Uri, in this case we are using the Odata API to return all project Id’s and filter out the timesheet project but this could be updated to select only projects based on your logic such as projects with a certain custom field value or projects not published in a certain number of days / weeks etc. Then add the HTTP headers as seen. This action will get all of the projects based on the Odata query. Next we need to loop through all of the projects in the array to check them out, publish them then check them back in. To do this we need to use an “Apply to each” action:

image

In the output from the previous step we use body(‘Send_an_HTTP_request_to_SharePoint_-_get_projects’)[‘value’] to use the data from the previous step which is all of our Project Online projects minus the timesheet project in this example. Then for each project in the array we check out the project using another “Send an HTTP request to SharePoint” action:

image

This time the HTTP Method is a POST and the Uri is set to use the REST CSOM API to check out the project. We pass in the ProjectId from the current item in the array using items(‘Apply_to_each’)[‘ProjectId’]

The final action is to publish the project and check it in, this is done using another “Send an HTTP request to SharePoint” action:

image

The HTTP Method is a POST and the Uri is set to use the REST CSOM API to publish the project and check it in – the check in is performed using the true parameter. We pass in the ProjectId from the current item in the array using items(‘Apply_to_each’)[‘ProjectId’]

The final variation of this publish all example is only very slightly different, the only difference is that it is manually triggered rather than on a schedule. We have removed the schedule action and replaced it with a SharePoint trigger to trigger when an item is created on a list:

image

I have a list on my PWA site that only PWA admins can access, here an admin user creates a new item, this then triggers the publish all flow:

image

We then have a history of who triggered the publish all jobs and when.

This post will hopefully give you some ideas on how Microsoft Flow can now really compliment Project Online and offer some scenarios for low / no code customisations.

In the next post we will look at more examples for building low / no code solutions for Project Online using Microsoft Flow.

#ProjectOnline Publish all projects using #MSFLow #MicrosoftFlow #PPM #PMOT #Office365 #PowerPlatform part 1

December 6, 2018 at 12:00 am | Posted in Add-on, Administration, Configuration, Customisation, Functionality, Information, Performance, Reporting, Workflow | 1 Comment
Tags: , , , , ,

I recently had the opportunity to present at a Microsoft Tech Sync session where I presented a session on Project Online and Flow. During this session gave examples of how Microsoft Flow compliments Project Online by enabling no / low code solutions to extend the Project Online features. I plan to do several blog posts over the next month or so where I will share some of these Microsoft Flows. Hopefully this will give you some ideas of how Microsoft Flow can be used to simplify some of those customisations for Project Online.

The first Flow example I want to share with you is a publish all projects flow. I have published examples before for Project Server and Project Online as found here:

These all required a basic understanding of the Project Server / Project Online APIs and somewhere to run the code from – I thought this would be a good example to move over to a Microsoft Flow. In this blog post I will walkthrough the first example I have for publishing all projects as seen here:

image

This is built using only actions from the Project Online connector in Flow – so there is no need to understand the Project Online APIs! This Flow assumes you have setup the connection to Project Online using an account that has publish access to all projects. This Flow is triggered using a schedule as seen here:

image

When this Flow is triggered, the first action is to get all the Project Online projects using the List Projects action:

image

All you need to do is provide the PWA site URL. This List Projects action also includes project templates so these need to be filtered out, to do this we filter the results returned from the List Projects action using a Filter Array action:

image

In the From field we enter body(‘List_projects’)[‘value’] to get the data from the previous action, which in this case is the List projects action. In the filter we use item()[‘ProjectType’] is not equal to 1, Project Type 1 being the Project Templates. In advanced edit mode it looks like this:

image

Next we need to loop through all of the projects in the array to check them out, publish them then check them back in. To do this we need to use an Apply to each action:

image

In the output from the previous step we use body(‘Filter_array’) to use the data from the previous step which is all of our Project Online projects minus the project templates. Then for each project in the array we check out the project using the default Checkout project action:

image

Enter the Project Online PWA URL then in the Project Id property pass in the Project ID from the current item in the array using items(‘Apply_to_each’)[‘Id’]

The final action is to publish the project and check it in, this is done using the default Checkin and publish project action:

image

Enter the Project Online PWA URL then in the Project Id property pass in the Project ID from the current item in the array using items(‘Apply_to_each’)[‘Id’]

That is it, when this flow executes it will publish all of your Project Online projects. A simple no code serverless solution!

In part 2 we will look at two other variations for publishing all projects in Office 365 Project Online using Microsoft Flow.

Blog at WordPress.com.
Entries and comments feeds.