Unlike the out of the box ability to export planner to excel, Power Automate does not support this natively. Whilst there is an action to list tasks, some of the data is referenced by GUIDs/IDs or category names, for example assigned to users, bucket ids or labels. I have built an efficient flow that will hopefully allow you to export your planner tasks for a specific plan to a new Excel File, containing a table, ready for you to use elsewhere. This is a proof of concept and so I highly recommend that you test. If there are features that you feel are missing or other fields that you would like included, please drop me a message.
The flow is compact and looks likes follows:
There are 4 key areas to the solution:
1. initial explanation, listing tasks buckets and plan details (for label categories)
2. retrieving all users by ID that have been assigned a task and returning their display name
3. for each task, creating an object of key/values and outputting an array
4. a basic method for creating an Excel File with Table containing the data from the Array
Stage 2:
I ultimately compile an array of distinct UserIds so that I can look them up and create an object of Userid/DisplayName Key/Values.
Output:
This enables all project users to be selected by ID and is a far more efficient way of using get user profile, as we don't need to do this for all tasks where multiple users may be assigned.
Stage 3:
There are 4 scopes to get the more tricky data, but here I gather individual arrays of:
1. assignedTo Display Names
2. CheckList Items
3. Categories/Labels (by bespoke name, colour or fallback category number)
4. CheckList Totals / Count
The output is an object for each item:
Stage 4:
Is a very easy method to create a new excel file, table and populate the rows using an apply to each. You can use Excel Scripts or Graph API to populate a file if you so wish, I have examples of the former on my YouTube.
Please note that if you want to bulk import tasks to planner, I have a video and downloadable flow via my YouTube here https://youtu.be/n3foHWH1XpU. Feel free to check out my YouTube for other ideas and concepts too and don't forget to like and subscribe.
Sample Task JSON can be seen below:
Hello,
I was able to get this working and everything looks good. I was hoping to make a (hopefully) small change of being able to manually filter which bucket from a Planner group is being exported and have been unsuccessful. This is my first Power Automate project, so any guidance would be helpful.
Our goal is to be able to manually export a singular bucket into Excel after we're done using it for an archive of sorts before deleting the bucket.
The Automation work perfectly, However when changing plans i get the following error : Action 'Get_user_profile_(V2)_2' failed.
Some tasks have not been assigned to a owner as of yet. not sure if this would make the failure. Could this be a permission issue?
@Anonymousthat is a permission issue yes, but seems like no account is assigned to that. You will need an account that has permissions to see all O365 users, normally that is also the same account that is making the flow, tho it may be different.
Find that step in your flow and ensure you have a connection set up for it, if not, Add a connection (it should guide you) to add an account that can see O365 User profiles. I have one as you can see with the blacked out spot.
I just checked and i have the connection in place however i believe it is a problem with regards to a user not being found.
This is the error i am getting once i jump to the failed issue.
I also have the same problem of a user not being found in my flow. I have all of the necessary plug-ins turned on; I have the connection to office 365 which should allow me to access the users but yes, still an error here.
@Anonymousand @Riki your user UPN string is shorter than what I see on my end, all of my users look like
"1234f567-0123-4567-a1b2-3c45d67b8910"
I am unfamiliar as to why you'd get that shorter string, is there a task with a weird user assignment in your planner? I am just guessing at this point. Earlier up in the flow, for that failed user "SelectUserIDsForEachTask" do you see a regular input for that specific task?
@DamoBird365might be more familiar with this?
That error is corrected in the first few comments on this post. They ended up having to change the formula to allow the absence of a label.