“I just created a bunch of Planner tasks using Power Automate and now I’d like to send users link to each task, is that possible?”
When you automatically create tasks in Planner, let it be from Excel or SharePoint template, you probably want to assigned them to users. And when you assign them, you might want to tell the users. Planner has a basic functionality to set notifications, but it’s personal notification setting. If users decide to turn it off there’s nothing you can do about it. Therefore, it might be better to build the notifications by yourself. Emails sent automatically by a flow, impossible to disable, that’ll include the task information including the task link. And this post will tell you how to build the link.
Get a link to a task
The best start to building a universal task link is to pick a random task and get its link.
The link will have a format similar to the one below.
https://tasks.office.com/tomriha.com/Home/Task/j8H5ceLj30aLOlmxnaF0zpgAL70m?Type=TaskLink&Channel=Link&CreatedTime=637924629976670000
You can see that it contains multiple parts:
https://tasks.office.com/ (fixed link to planner part 1)
tomriha.com/ (your domain)
Home/Task/ (fixed link to planner part 2)
j8H5ceLj30aLOlmxnaF0zpgAL70m (task id)
?Type=TaskLink&Channel=Link&CreatedTime=637924629976670000 (additional parameters)
Build a link to a task
If you check links for multiple tasks, you’ll see that the first 3 parts are always the same. The difference will be between the task id and the additional parameters. And since the additional parameters are not important, all you need to build a link is the task id.
https://tasks.office.com/<your domain>/Home/Task/<task id>
Use the concat(…) expression to build the link and use it in your flow, e.g. link to a new task.
concat('https://tasks.office.com/tomriha.com/Home/Task/', outputs('Create_a_task')?['body/id'])
The same approach can be used also to add HTML table with links to a task report. All you have to do is combine the expressions together.
concat('<a href="', concat('https://tasks.office.com/tomriha.com/Home/Task/', item()?['Id']), '">Link to item</a>')
Summary
If you want to automate some existing functionality, it’s always helpful to check how it works manually. In this example you manually created a link to Planner task and replicated the functionality in Power Automate. There is a fixed part of the link that’ll be always the same, all that has to be changed is the task id. Such link can be then sent to the users, let it be via email or a Teams message.
HI I followed your instructions and all work well but a little issue it seems security in my domain make the URL extremely large (448 caracters)
https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.planner/tt.c_19:dkXSg3NVYVPI1kxZxMVqufnQDIqIs4JoKhsgL9op_dQ1@thread.tacv2_p_dX3kQV-k9kaAbeq8Z0dgSZYACqHE_h_1684525024108?tenantId=aca3c8d6-aa71-4e1a-a10e-03572fc58c0b&webUrl=https://tasks.teams.microsoft.com/teamsui/personalApp/alltasklists&context={“subEntityId”:”/board/task/Ipra3y7nY0udPVq30I5z95YABrNF”,”channelId”:”19:dkXSg3NVYVPI1kxZxMVqufnQDIqIs4JoKhsgL9op_dQ1@thread.tacv2″}
and when I try to send it as href=”compose output” in an html the URL is cut at 316
https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.planner/tt.c_19:dkXSg3NVYVPI1kxZxMVqufnQDIqIs4JoKhsgL9op_dQ1@thread.tacv2_p_dX3kQV-k9kaAbeq8Z0dgSZYACqHE_h_1684525024108?tenantId=aca3c8d6-aa71-4e1a-a10e-03572fc58c0b&webUrl=https://tasks.teams.microsoft.com/teamsui/personalApp/alltasklists&context={
This happens everysingle time, the weird thing is that the compose with concat gets the rigth value, this is also ccorrect in the HTML for outlook send mail v2 where I call it.
Is there anything I can do to shorter the URL or make the emails like outlook or gmail to receive the full URL?
Hello Eder,
that’s an interesting problem, I wouldn’t expect that it’ll prolong hard coded urls in an email/teams message. I’ve never seen it so I never needed to solve it.