Categories
Automation Project Management

Flexible Project Management: Adding Actions to a Task List

The content explains how to replicate Planner’s ‘Checklist’ feature in a SharePoint task list using a separate actions list and Power Apps form. It details steps to create the actions list, build and customize the Power Apps form, and link actions to tasks. Finally, it covers adding, displaying, and updating actions linked to tasks.

A great feature of Planner that isn’t easily reproducible in a SharePoint list is the ‘Checklist’, where you can add actions to a task and check them off, providing the team with an understanding of what needs doing to complete the task, as well as an auditable history of progress.

Fear not, dear readers, and join me on a journey to add this feature to a task list using a separate list and a Power Apps form.

Actions list

First step is to create a list for your actions, preferably on the same site as the parent list, adding columns for:

  • Title – rename this default text column ‘Actions’
  • Responsible – as a person column
  • Status – Choice column, with values such as ‘Not started’, ‘In progress’, and ‘Complete’
  • Effort (Hours) – a number column with one decimal place
  • TaskId – single line of text column

It might look something like this:

Switching to a Power Apps Form

Next step is to create our Power Apps form to create and edit tasks. Head to the parent list and choose ‘Integrate/Power Apps/Customise Forms:

Under Settings/Display choose ‘Landscape’ and ‘Large’:

Delete any content on the form, and click ‘Insert/Edit Form’ and call it ‘EditItemForm’. In the properties menu set the columns to ‘3’, layout to ‘Vertical’, and default mode to ‘New’. Then click ‘Edit fields’ and add the fields from the parent list you’d like to appear, dragging them around the form editing screen until they appear in the correct order and the right format. It’s good practice to give each a field relevant HintText.

Be sure to add the ‘ID’ field somewhere, and set the ‘Visible’ property on the data card to false; this is what will be used to connect the task list with the actions list.

In the ‘Item’ field of the form, add the following code:

If(IsBlank(SharePointIntegration.Selected),EditItemForm.LastSubmit,SharePointIntegration.Selected)

Add a ‘Save and close’ button at bottom right with the following code in the ‘OnSelect’ property:

SubmitForm(EditItemForm);RequestHide()

Click on ‘SharePoint Integration’ and ensure the following fields have the following values in them:

  • OnCancel: ResetForm(EditItemForm)
  • OnEdit: EditForm(EditItemForm)
  • OnNew: NewForm(EditItemForm)
  • OnSave: SubmitForm(EditItemForm)
  • OnView: EditForm(EditItemForm)

Before we add our list of actions, save and test the form to ensure it is working. Assuming it is, let’s work on adding actions to our tasks.

Adding an Action to a Task

Add a ‘Save and add actions’ button, adding SubmitForm(EditItemForm); into the ‘OnSelect’ field and If(EditItemForm.Mode = FormMode.New, true, false) into the ‘Visible’ field so it only displays when the task hasn’t been added yet.

Next click ‘Add data’ and select the actions list. Add a field from that data set for each of the columns beneath the EditItemForm, and a ‘Create action’ button. In the ‘OnSelect’ property of the button, enter the following code, editing the highlighted text so it matches the titles of the input fields on your form:

Patch(Actions,Defaults(Actions), {Title: TextInput1.Text, 'Effort (hours)': Value (TextInput7.Text), 'Responsible': ComboBox3.Selected, Status: Dropdown1.SelectedText, TaskId: DataCardValue16.Text});Reset(Dropdown1);Reset(ComboBox3);Reset(TextInput1);Reset(TextInput7);

Once added if you click on the button, other than the hidden TaskId field, Power Apps will highlight and colour-code the fields with those specified in the patch statement:

To ensure those fields and the button don’t display on a new form, insert a rectangle shape with a white background over it, and set the visible property to If(EditItemForm.Mode = FormMode.New, true, false)

Updating a Task’s Actions

To show items from the actions list connected to the task, click ‘Insert/Gallery’ and choose the Actions list as the data source. Add the fields to the gallery, aligning the columns with the fields above.

To ensure only actions related to the task in hand appear, in the Items property of the gallery add Filter(Actions, TaskId = DataCardValue16.Text) where DataCardValue16 is the hidden id field from your task list.

Finally, add an ‘Update action’ button with the following code in the ‘OnSelect’ property, changing the highlighted values to the names of the elements on your screen:

Patch(Actions, Gallery3.Selected, {Title: TextInput6.Text, 'Effort (hours)': Value (TextInput8.Text), 'Responsible': ComboBox2.Selected, Status: Dropdown2.SelectedText, TaskId: DataCardValue16.Text})

Save, test, and if it’s all working as expected ‘Publish’. Congratulations, your task list should now replicate the usefulness of Planner’s ‘checklist’ feature, with the ‘actions’ showing as rows beneath the task in the image below:

This article is part three of the Flexible Project Management Information Handyman series:

  1. Flexible Project Management with SharePoint Lists and the Power Platform
  2. Issuing a weekly digest to each responsible person listing their upcoming and overdue tasks
  3. Adding sub-tasks, or actions, to your project tasks using another list and a Power Apps form
  4. Building a custom Power BI report to gain insights on team activities and report on progress

Leave a Reply

Your email address will not be published. Required fields are marked *