Hey Flow Community!
how can I get the attachment of a Planner task in Power Automate (Flow)?
I want to assign a task to a new person includes the attachment of another completed task,
actually the trigger is (when a task is completed in Microsoft planner)
I can't find a way to get the attachment of the completed task to update newly created task
Getting the attachment of a planner task can not be done directly in Power Automate,But it is possible by using this workaround.
This flow is also work for more than One attachment added with the task in Microsoft Planner.
1. Use a trigger (When a task is Completed)
- In Group Id and plan Id (Enter the static Value (November Planner in my case. See Attachments))
2.Use Action (Get task details) to get details of task which is completed.
-In TaskId (Enter Dynamic Content "Id" from above trigger i.e triggerOutputs()?['body/id']
3.Use Another Action (Select)
-In From Enter Dynamic content- "References" i.e outputs('Get_task_details')?['body/references'] and
-In Map- first click on the T symbol and then Enter Dynamic content-"Reference Alias" i.e item()?['value/alias']
4. Now, Use Apply To Each
In Apply to Each Use Action (Get File Content using Path)
-In 'select an output from previous step' - Use Dynamic output of Action "Select"
-Select Site Address (November planner in my Case) and
-In File Path use- /Shared Document/items('Apply_to_each')
Now you can Send mail of that attachment file using the Action (Send an email V2) action in apply to each or use that attachment file wherever you want.
Please see image attachment below for better understanding.
Did you like my post? Please give it a "thumbs up!"
Did I resolve your issue? Please click "Accept as Solution" to close the topic and so other members of the community can find solutions more easily.
I've followed what you have put (I think) but I keep getting a 404
I have a Get task details to retrieve the ID of the task then within an Apply to each I have used the 'References' from the Get task details and added the 2 sharepoint connectors you mentioned
Any ideas why it is not working?
Hey there, thank you for your tips.
I managed to send attachments from Planner directly to Outlook, using this workaround. Basically, you must get the details from your Task, and create an array variable, to storage the attachments.
In an Apply to each, you will use the sharepoint connectors 'Get file content using path' and 'Get file metadata using path', insert you website address, and in the file path put "\Documents\items('Apply_to_each')?['value/alias']". At last but not least you should append the array corresponding to the attachment, in the following pattern:
{
"Name": "@{outputs('Get_file_metadata_using_path')?['body/Name']}",
"ContentBytes": "@{body('Get_file_content_using_path')}"
}
Now outside the Apply to each, you simply will add the Send an email (V2) connector and in the advanced options, click on the T symbol(Switch to input entire array), and place the Attachment array right there.
As a matter of fact... you can, but it's a workaround.
File attached to a planner task are not stored "inside" the planner task itself.
Instead they're stored as shared files into the underlying sharepoint site, under the "Documents" folder and they're only linked in the task, among all the other "references" stored in the task.
In Power Automate, using the "References" property of the "Get task details" method of the Planner connector, you can loop throught all the references.
The link to the file is stored in the sub-property "referenceLink". It's an URL.
Also the complete filename is in the "value\alias" sub-property.
Finally, using the "Get file metadata using path" method of the Sharepoint connector, you can point to each file by path, composing the path by concatenating the "Documents" folder base path, which is fixed, and the filename extracted earlier, and then do whatever you want with the file from there.
Unfortunately Power Automate does not support retrieving attachments from the task.
I had a looked around Microsoft Graph API but this feature is not available now.
To get this reviewed and included as a functionality, you can create an idea or upvote similar ones here: https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas
Thanks
Hi @shahabarvin