Following on from my two PowerApps posts on creating an example Project Online PowerApps app, I thought I would publish the example PowerShell script that I used to populate and update my SharePoint list in the Project Web App site collection. For those that missed my Project Online PowerApps posts, please find the links below:

This PowerShell script will use the Project Reporting OData API to get all of the published projects in the Project Online PWA Site Collection, then for each project it will then create or update a list item on the specified SharePoint list. If the project has already been created on the SharePoint list on a previous run, the items will be updated rather than creating a new item.The user setting up the script will need to make some changes to the script, this is covered in the blog post.

The account used will need access to the OData API in PWA and contribute access to the target SharePoint list. The SharePoint list will also need to be created beforehand with the required columns.

To get the script to work you will need to reference the DLL as seen in the image below:

This can be installed from the SharePoint Online Client components / management shell. I used the dll from the SharePoint Online Management Shell in this example.

Firstly decide what project level fields you want to include in your PowerApp / SharePoint list, this will determine the list column requirements. Then create the SharePoint list in the PWA site collection with the required columns, for this example I created a list called ProjectData with the columns below:

Title is used for my Project Names in this example. You will then need to update the list item update / creation part of the sample script to map to the correct SharePoint column names you created and the project fields:

Also ensure the variables have been updated correctly, placeholder values seen below:

Whilst the purpose of this script was to enable us to get the data into a SharePoint list and keep the data in sync for our PowerApp, it can be used for other purposes. For example, you could use this example script to modified the last script I published for HTLM fields to update existing items rather than creating new items each run. Do keep in mind that this SharePoint list would not be security trimmed like a Project Center view though, so you might want to restrict access to the SharePoint list depending on your data / security policies for your PPM data.

The script is provided "As is" with no warranties etc.

Rate this:

Share this:

Like this:

[…] in that source SharePoint list and displayed those in my example app. I used a custom process to populate the SharePoint list with the Project Online data and kept that data in sync. In this series of blog posts we will look at how to use the native […]