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

April 26, 2018 at 10:01 pm | Posted in Add-on, Administration, Configuration, Functionality, Information | 1 Comment
Tags: , , , ,

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:

image

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:

image

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:

image

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

SNAGHTML1164f9e

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:

image

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

image

Now set the group visible property to Off:

image

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

image

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

image

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:

SNAGHTML12b8166

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:

image

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:

image

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.

Advertisements

Blog at WordPress.com.
Entries and comments feeds.