web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to delete attachme...
Power Automate
Unanswered

How to delete attachment in Microsoft Planner?

(0) ShareShare
ReportReport
Posted on by 8

Hi everyone,

I've been trying to update a Planner task so that only the latest attachment is included in the References field. However, the old attachments are still there, combined with the new ones.

What I’ve Tried:

  • I used an Append to Array Variable to handle the attachments. It does get the latest one correctly, but when I use the Update task details action, the task still shows the old attachments along with the new one.

What I Need Help With:

  • Is there a way to overwrite the old attachments in the References field with just the latest one?
  • Any tips on how to clear the old references before adding new ones?
Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    You could probably do this with a Graph API request: Update plannerTask - Microsoft Graph v1.0 | Microsoft Learn. I have not had any need to do this, but I asked Copilot and it says it should be possible to do this with a patch request through the Graph API.  I don't have time to test this since it isn't something I see needing in the near future, but I did find similar questions to yours in the forums and none have a verified answer. If you can get it working, it would help a number of people.
     
     
    This is what Copilot suggests but in plain text:
     
    To remove all attachments from a Planner task using the Microsoft Graph API in Power Automate, you need to follow a two-step process. First, retrieve the current details of the task to get the @odata.etag value, which is necessary for the update. You can do this by making a GET request to the endpoint:
     
    https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details.
     
    Once you have the task details, use the PATCH method to update the task details and remove the attachments. This involves setting the attachments property to an empty array. The PATCH request should be sent to:
     
    https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details
     
    Include the If-Match header with the eTag value obtained from the GET request. In Power Automate, you can use the HTTP action to make these API calls. First, configure the HTTP action to get the task details, and then use another HTTP action to update the task details and remove the attachments by setting the attachments property to an empty array. This process ensures that all attachments are removed from the specified Planner task.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard