Applies to: SharePoint online and On-Premises
Lookup columns are used frequently to relate items in one list with other. Most common scenario is when a single selection lookup is created in one list to associated one or more items of that list to an item of the list used in the lookup column. For example, a task list having a lookup column of Tickets list. In this case, multiple tasks can have same Ticket as the lookup column value and all these tasks will then be the associated tasks for that Ticket. We can also have the same relation in case of Tasks and sub-tasks wherein the sub-task list will have the lookup to the task list.
Using NITRO Forms and Linked Items apps, the associated items can be shown within the form/list view of the main item. That is, Ticket item form will show all the associated tasks for that Ticket and also allow user to add/edit the tasks for that Ticket.
In this scenario, it is possible to complete multiple associated tasks in a single operation using NITRO Custom Actions. You can also use the same steps to take other actions on multiple associated items (like re-assign, send mail etc.). In custom actions, we have the ability to query the associated items with the required criteria. These items can be shown to user for further selection. And for the selected items in, we can execute the actions like update item or send mail as per the requirement.
This article describes steps to mark complete the user selected sub-tasks of a parent task.
Summary of Steps
- Required list schema
- Create custom action to complete the tasks
- Query list action to get all the open sub-tasks
- Update item action to complete all the sub-tasks
1. Configure List Schema
We need separate lists for Parent Tasks and the Sub-tasks. Sub-tasks list will have a lookup column with lookup list as the Parent Tasks list.
2. Create a custom action on Parent Tasks list to select and complete the sub-tasks
Create “Complete Subtasks” custom action in Parent Tasks list as shown below.
Go to Parent Tasks list -> List Settings -> Crow Canyon Custom Actions and configure a custom action as shown below:
Action 1: Query list
Configure a query list action to get all the open sub-tasks that are associated to the parent task
<FieldRef Name='ParentTask' LookupId='TRUE' />
Action 2: Mark selected sub-tasks as Complete
Configure update item action to complete all the sub tasks.
How to execute the action
Go to Parent Task list -> Open parent task display form and run the “Complete Subtasks” action.