
Announcements
Hi all,
I am trying to find a way to get all checklist items from a task which has been marked as complete, and then create a new task with these unchecked items added to the checklist for this new task.
Is this possible?
I currently have these elements to my flow:
The outputs from the 'get task details' section shows whether a checklist item is checked, but I do not know how to add these into a useable format to add to a new task.
Any help is appreciated
@Gwill1983 You are missing a few actions in your flow.
I would recommend that you start off with a Manually triggered flow. Also, I like to always have a copy of a Manually triggered flow (especially when the final trigger is automated). Should my flow run into any issues down the road, or if I want to make any modifications—I can trigger the flow manually and copy over any actions from my manual flow to my automated flow.
This will save you time while building your flow as you can manually trigger it—rather than having to go into Planner and mark a task complete just to trigger it.
Tip: Rename your actions to keep your flow organized. Test often so that you can troubleshoot any issues early on.
Add a Compose action. This is an optional step. However by storing the ID of a task for testing purposes, when you are ready to adjust the flow trigger you will only need to insert the ID dynamic content into the Compose action rather than needing to insert it into multiple actions. This will save you time.
You can grab the Task Id from any completed task by clicking on the three dots of the task and selecting Copy link to task.
The task ID appears just before the question mark in the URL. Double-click on the Id to highlight it and copy it to your clipboard.
Paste it into your Compose action.
Add a Get task details action to your flow and insert the output from the Compose action above into the Task Id field.
In my demo I will be using the task's original title in the new task, for that reason I need to add a Get a Task action. I've inserted the output from the Compose action above into the Task Id field.
Add a Compose action. This Compose action is optional. However, to help you to better understand what is going on in your flow—I'd recommend adding it.
You'll use this Compose action to store the total number of Checklist items from your task. Insert an expression and use the length() function.
Click on the Dynamic content tab and insert the Checklist dynamic content from the Get task details. This Compose action will output the total number of Checklist items in your task—checked and not checked.
Add a Filter Array action. In the From field, insert the Checklist dynamic content.
In the first value field insert the Checklist is Checked dynamic content. Leave the operator to is equal to.
If you review the output from the Get Task Details action, you will see that any checklist items that haven't been checked off have an isChecked value of false.
Enter false (in lowercase) into the second value field.
Just as you've done above. Add a Compose action to store the number of items from the Filter Array action. Whenever I use a Filter Array action I always use a Compose action to store the number of items returned—this helps with troubleshooting and I can confirm the number of items returned is what I'm expecting.
Run a test. Review the output of both Compose actions. You can see in my screenshots I have a checklist count of 5 items (these are all items from my completed task) and 3 items that are unchecked.
You'll need to format the content of the checklist items before you can use them in an action to add to a Planner task.
For that, you'll need a Select action. In the Form field, insert the body from the Filter Array action above.
In the Map Key fields you'll need to enter one for each of the following keys (as they are displayed below):
Enter false into the value field for the isChecked key as you are only adding checklist items that weren't previously checked. This can be hardcoded into the action.
You'll need to use expressions for the id and title values. Enter this into the expression field:
item()?['']
Between the single quotes, you'll need to enter a dynamic content key. If you take a look at the output of the Filter Array action, the dynamic content key for id is 'id'. Enter that between the single quotes.
If you take a look at the output of the Filter Array action, the dynamic content key for title is 'title'. However, it's nested inside the value dynamic content key. Enter 'value/title' between the single quotes.
Run a test. The output of the select action should look like my screenshot below. Verify the ids and the titles are correct.
Add a Condition action to your flow. Use this action to check if there are any non-checked checklist items before continuing on with your flow. If there are, run the next couple actions. If not—do nothing.
Insert the output from the Compose action storing the count of Non-Checked checklist items into the first value field. Change the operator to is not equal to. Enter zero into the second value field.
Add the next actions into the YES branch of your flow.
Add a Create a task action to your flow.
I've inserted the Title dynamic content from the Get a task action into the title field. Insert whatever Dynamic content you'd like to insert to suit your requirements.
Add an Update task details action to your flow. In the Task Id select Enter Custom value from the dropdown.
Select the Id dynamic content from the Create a Task action. You want to update the task you've just created—not the one that has triggered your flow.
In the Checklist section, click on this icon to switch to input entire array.
Insert the output from the Select action.
There are quite a few actions that were added to the flow just to return the checklist items. I like to use Scope actions in my flow to group actions together so that I can quickly collapse them. This is an optional step.
The Scope action can reduce the vertical space your flow takes up making it easier to navigate.
Run a test. Below is a screenshot of my test task which is complete. Note the three checklist items that were not checked off.
Below is what the new task looks like and you can see the three checklist items have been created.
As I mentioned at the beginning of this post—I'd recommend keeping a copy of the manually triggered flow. Once your flow is ready to go, select Save As to create a copy of your flow.
You can adjust the trigger of your flow to When a task is completed. Instead of having to insert the ID dynamic content from your trigger into various actions in your flow. Replace the testing ID with the ID dynamic content from your flow trigger.
Run a test.
Hope this helps!
| If I helped you solve your problem—please mark my post as a solution ✅. Consider giving me a 👍 if you liked my response! |
If you are looking for a way to send multiple SharePoint List items that have been assigned to a user in an email—check out this YT Tutorial: How to Send a SINGLE EMAIL ✉️ with multiple SharePoint list items | Build THIS Power Automate Flow
In this tutorial I cover:
✅ How to send multiple list items in a single email with a Power Automate Flow
✅ How to create a dynamic date range
✅ How to use the Convert Time Zone action
✅ How to use a Filter Query in the Get Items action
✅ How to count number of items in an array
✅ How to use the Select action to extract a users display name and email address
✅ How to create a unique list of email addresses
✅ How to use the Create HTML Table action
✅ How to customize the HTML Table with CSS styles
✅ How to use the Send an email (V2) action
✅ How to use the Append to String Variable action
✅ How to create a custom list of items for an email
✅ How to use the Send an email (V2) action
✅ How to display singular or plural text based on the number of items returned