Easiest Ways to Attach Files to Planner Tasks Using Power Automate

I currently work with a client who wants to simplify their workflow in Microsoft Planner. They needed files automatically attached to tasks whenever specific actions happened, like adding a file to SharePoint. This saved them time and ensured their team had the correct files ready for their tasks.

In this tutorial, I will show you how to attach single and multiple files to planner tasks using Power Automate.

Attach Files to Planner Tasks Using Power Automate

Imagine you are managing a project where team members regularly upload important documents, such as project briefs or status reports, to a SharePoint document library. Ensure these files are automatically attached to corresponding tasks in Microsoft Planner to keep everything organized.

For this example, I created a SharePoint document library called Project Documents:

Attach Files to Planner Tasks using Power Automate

Before I explain how to create the flow, we must create a plan in Planner. To create a new plan in Planner, log in with your credentials. Click on +New Plan in the left navigation, provide a name for the plan, select an existing group, and then click Create Plan.

power automate add attachment to planner task

Now follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger When a file is created (properties only). Also, provide the Site Address and Library Name.

add attachment to planner task power automate

2. Add Create sharing link for a file or folder action and provide below parameters:

  • Site Address: Select the SharePoint site address from the drop-down.
  • Library Name: Select the library name where your file will be uploaded.
  • Item Id: Select the Id from the dynamic content (When a file is created (properties only)).
  • Link Type: Select the link type based on the requirement.
  • Link Scope: Select the link scope based on the requirement.
power automate planner attachment

3. Next, add Create a task action and provide below parameters:

  • Group Id: Select the Group Name of your plan.
  • Plan Id: Select the Plan Name.
  • Title: Provide the title from the dynamic content, or you can give your name.
  • Bucket Id: Select the bucket id as Todo.
  • Start Date Time: Provide the below expression, as the start date always equals today:
formatDateTime(utcNow(),'yyyy-MM-dd') 
  • Due Date Time: Provide the below expression:
addDays(utcNow(),3,'yyyy-MM-dd')
  • Assigned User Ids: Provide the assigned user id.
power automate planner add attachment

4. Then add the Update task details action and provide the below parameters:

  • Task Id: Select the Id from dynamic content.
  • Description: Provide the description.
  • Reference Alias 1: Provide the Name from (When a file is created (properties only) action).
  • Reference Resource Link 1: Provide the Sharing link from dynamic content.
power automate attach file to planner task

Save the flow, go to the SharePoint document library, and add the file.

power automate planner to sharepoint list

After the flow runs successfully, go to Planner. You will see that the task has been created, and the file is attached.

how to attach single files to planner tasks using Power Automate

Add Multiple Files to a Planner Task using Power Automate

In the example above, we saw how to add a single file to a Planner task. I will show you how to add multiple files to a Planner task using Power Automate.

Now follow the below steps:

1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

power automate planner update task details

2. Add an “Initialize variable” action, provide a name for the variable, and set the type to Array.

Add Multiple Files to a Planner Task using Power Automate

3. To retrieve multiple files, add the Get files (properties only) action and provide the below parameters:

  • Site Address: Select the SharePoint site address from the drop-down.
  • Library Name: Select the library name where your file will be present.
add multiple attachments to planner task power automate

4. Add Create sharing link for a file or folder action and provide below parameters:

  • Site Address: Select the SharePoint site address from the drop-down.
  • Library Name: Select the library name where your file will be uploaded.
  • Item Id: Select the Id from the dynamic content (Get files (properties only)).
  • Link Type: Select the link type based on the requirement.
  • Link Scope: Select the link scope based on the requirement.
power automate add multiple attachments to planner task

5. Inside For each, add Append to array variable action and provide below parameters:

  • Name: Select the variable name from the drop-down.
  • Value: Provide the below expression:
{
  "alias": @{item()?['{Name}']},
  "resourceLink": @{outputs('Create_sharing_link_for_a_file_or_folder')?['body/link/webUrl']}
}
Using Microsoft Power automate add multiple file to planner task

6. Next, add Create a task action and provide below parameters:

  • Group Id: Select the Group Name of your plan.
  • Plan Id: Select the Plan Name.
  • Title: Provide the title from the dynamic content, or you can give your name.
  • Bucket Id: Select the bucket id as Todo.
  • Start Date Time: Provide the below expression, as the start date always equals today:
formatDateTime(utcNow(),'yyyy-MM-dd') 
  • Due Date Time: Provide the below expression:
addDays(utcNow(),3,'yyyy-MM-dd')
  • Assigned User Ids: Provide the assigned user id.
Add Multiple File to a Planner Task using Power Automate

7. Then add the Update task details action and provide the below parameters:

  • Task Id: Select the Id from dynamic content.
  • Description: Provide the description.
  • Reference: Provide the above array variable from dynamic content.
Add Multiple Files to a Planner Task in Power Automate

Now, click on save and run the flow manually. After the flow runs successfully, go to the planner, and you can see your task gets created with multiple files.

How to Add Multiple Files to a Planner Task using Power Automate

Conclusion

In this tutorial, I explained how to attach files to planner tasks using Power Automate. We started by setting up a flow to attach a single file to a task whenever a file is added to a SharePoint document library. Then, I expanded on how to attach multiple files to planner tasks using Power Automate.

Also, we cover below examples:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…