Home > Paul Mather, Work > #ProjectOnline #PowerApps using the Project Online Connector #PPM #Apps #MSProject #O365 Part3

#ProjectOnline #PowerApps using the Project Online Connector #PPM #Apps #MSProject #O365 Part3

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)

In part three of this series of blog posts we will look at using the CreateProject action from the Project Online PowerApps Connector. For those of you that missed part 1, here is a link: https://pwmather.wordpress.com/2018/03/14/projectonline-powerapps-using-the-project-online-connector-ppm-apps-msproject-o365-part1/ and part 2: https://pwmather.wordpress.com/2018/04/11/projectonline-powerapps-using-the-project-online-connector-ppm-apps-msproject-o365-part2/

The CreateProject action is: ProjectOnline.CreateProject({“PWASiteURL”}, {“ProjectName”},{Optional parameters}). As you can see, there is the PWA Site as one required parameter and the Project Name as the other. There are also optional parameters for description and start date as documented here. In this post we will add a new page to our example PowerApp to provide inputs to the parameters for the CreateProject action. Add a new blank screen to the PowerApp, in this example I called the new page NewProject:


Next I added a label to the page to add “Create a new project:” then two text input boxes, one for the Project Name and one for the Project Description. The two text input box properties were updated to remove the default text and add hint text as seen below for the Project Name input box:


Next a date picker was added to select the project start date along with two buttons, one to create the project and one to cancel / navigate back to the homepage. The button text was updated as required and the back button OnSelect property updated to navigate to the Projects page:


The create button action for OnSelect would be ProjectOnline.CreateProject("PWAURL", TextInput1.Text,{Description: TextInput2.Text, Start: DatePicker1.SelectedDate}) as seen below:


Update the control references such as TextInput1 as required. That is the minimum needed to create a new project but really there should be checks to ensure the name is set as that is a required parameter and also do things like clear the inputs once the project is created / navigate back the homepage automatically. Below is a simple example to ensure the project name input is not blank. Firstly add a new label with the text “Project Name is empty” then add a X icon:


Now select both of those elements from the left menu and group them together:


Now set the group visible property to Off:


Select the X icon and update the OnSelect action to UpdateContext({alert:false}):


Select the grouping then select the Visible property and change the value from false to alert:


Now click the Create button as the OnSelect action needs to be updated to If(IsBlank(TextInput1.Text),UpdateContext({alert:true}),ProjectOnline.CreateProject("PWAURL", TextInput1.Text,{Description: TextInput2.Text, Start: DatePicker1.SelectedDate})) as seen below:


Update the control references such as TextInput1 as required. Now if the Project Name input, in my example TextInput1, is empty the alert will be displayed with the X to close the alert:


The final part of this app is to add a button / icon from the home screen to be able to create a new project by navigating to the NewProject screen:


That’s it for now but hopefully enough to get you started with the Project Online Connector for PowerApps, there are more actions available for this connector and so much more you can do with PowerApps! Look out for more Project Online related PowerApps blog posts in the future.

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: