How to: add a task to To-Do from a selected Teams message

Teams got a huge amount of updates and new features during the summer 2020. They are all extremely interesting, but for this one I start off easy and something that can help lots of people: how to make a task out of a single Teams message.

It is recommended you read the whole post before starting to add this to your Teams. There is a catch you have to be aware or otherwise this one only works for the creator.

Note that these don’t work unless they are created to the default environment. https://docs.microsoft.com/en-us/power-automate/trigger-flow-teams-message

Update 18.8.: The flow action appears to all users who have permission to run it. If you add an organization wide team to Run-only users everyone in the organization gets access the the Flow. This makes it easy to distribute and target these flows to groups of users (Teams/Office 365 or security groups) or to individuals (named persons).

You can get started by adding a Power Automate (Flow) tab to your team. Or you can go directly to Power Automate site and start adding this functionality from there. The benefit from doing this in a team is that the team gets the ownership of that flow for changes (instead of just being your flow).

Choose + Instant – from blank and then select “For a selected message” trigger and hit Create.

You can then add an adaptive card with more inputs if you like to. You can leave it as default for simple approach.

Add a second step as “Add a to-do (V2)”. Searching for ‘add a to-do’ is a quick way to get the right action.

Fill in information using dynamic content + text of your choosing. The trigger brings in a nice set of information you can use. It also includes the link to the message, which makes using this really easy.

This is the full list of available dynamic content:

It is quite easy to just start adding information. To-do list can be a dynamic value.

Add link to the message using the code view:

Testing it out (hint: it only works for the creator – keep on reading!)

Once you name & save the flow you can see it in message “More actions” menu.

Since there isn’t any adaptive card nor inputs added the adding happens almost magically.

And the task appears in To-Do

And when you open the task you can see the notes part with link to the message

The GIF is previewed with link (in To-Do web) but when the notes is clicked the gif is activated.

So yes, this works. For the creator.

If you test this with another user they will not get that task added. Looking at the Flow runs you see there is an error.

Making adding to To-Do work for other users

The error happens because the task was added to a specific list (with id) that creator has. Yes – this can be fixed!

The key to make it to work for others is to retrieve the To-Do list id that is used when putting the task into. For that we need to add a “List all to-do lists” action.

Then you check is the task list name is “Tasks” or in my case the Finnish version “Tehtävät” and pick it up and use it’s value as default where you put the task into. The reason for using the default list name is that because it is found in everyone’s To-Do.

Instead of choosing the task list from the dropdown add a custom value that is used.

After saving the Flow it is time to test it with another user. And yes, it works!

Edit 18.8. Adding the Flow to all users goes via editing “Run-only users” contents.

You then manage run-only permissions and you can add individual users, teams, Office 365 groups or security groups. If you add an individual there the action is shown there quite fast but if you add a group there the sync takes a while before it appears there. Removal of group affects immediately.

It is easy to make the Flow available to everyone in the company by adding a relevant team to the run-only permissions. It also works with an organizational team so it can stay up to date and be available to everyone.

The full Flow

Add once – available to everyone or to selected groups of people

Any user in the tenant can then be using that specific flow – they have to grant flow permissions first (via run-only permissions described above). This is very useful for business processes and common needs. However, if there are specific actions that can be used by only a few persons it is not that great. Planning is needed so these flows are usable by everyone in the target group.

First time Flow users need to add permissions and approve the use.

Suitable use cases .. and there are no limits!

Since selected message flows apply to everyone in the company it is good keep in mind what actions you are doing with them. Adding a personal task, like in this example, is a great one since you can do this Flow once and everyone can use it. However if you are adding tasks to a specific planner in specic team –> it might not work due to lack of permissions.

This trigger action, combined with adaptive card (I will dive deeper into that in a later blog post) is opening up a new world for Teams adoption and usability. You can combine messages to business processes, to legacy systems, send information to sales or activate several processes at once.

As a repeat, this is the list of possible dynamic contnet you can use:

Cherry-picking a few ones: who wrote the original message (with id so you can notify user that task is done!), team and channel id (the context, perhaps choosing the planner board automatically from the team/channel) and information about the use who activated the flow (who initiated the process) with id so you can get user profile.

For Selected Message trigger is the giant leap when integrating Teams into business processes. Easily.

11 thoughts on “How to: add a task to To-Do from a selected Teams message

    1. When you build the flow you can choose to enter value to a field. It can be something you enter (hard-corded), have to choose (from a dropdown) or you can choose to use a custom value which can be filled with a dynamic value (from previous steps) or with a formula.

      Like

  1. Interesting – It works nicely and is a sorely missed feature in Teams which now works. Thanks. I have a couple of group chats with “private” channels. There the whole “more actions” is not visible at all. I guess a known-limitation for now

    Like

    1. Thank you! The native Add to Tasks functionality is roadmapped to February at the moment – so it is coming.
      Private channels have lots of limitations, unfortunately.

      Like

  2. Thanks for this helpful How-To.
    Is it possible to auto-reply to the sender of the Teams message (private Chat) something like “added to my To-Do List”?
    And a step further: Send a reply message if the To-Do is done (“It’s done”)?

    Like

    1. You can get “Sender User ID” from the trigger, so you can use Flow to send that user a message.
      As for the second question you could set up a To-Do trigger that will monitor updates that happen in a specific folder in your To-Do. The drawback is that you need to set this one up for every user separately and it only checks out a single folder there.
      It might be easier to have a automated flow running through your To-Do and matching that one with those added via your custom actions. This requires a bit more code naturally and you need to store those IDs somewhere.

      Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.