Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Trying to create a flow that assigns a new task to the mentioned user in the body text of a new post in a channel, as well as label the task according to keywords used.

(0) ShareShare
ReportReport
Posted on by

The attached picture is what it looks like so far. I'm trying to figure things out on my own with bits and bobs learnt from the internet. Also, the output from the 'Search for Users (V2)' step always produces an output of just "[]". Any help/insight would be greatly appreciated!

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Trying to create a flow that assigns a new task to the mentioned user in the body text of a new post in a channel, as well as label the task according to keywords used.

    @Dipsy  Here are some additional instructions

    Manual Trigger

    Start with a Manual trigger while you build and test your flow. You can replace it with the Automated trigger once you've confirmed your flow works and you are ready to go live. However, I prefer to actually keep a manually triggered copy of my flow. This can help with troubleshooting if you run into issues later on, or if you want to make changes to your flow. 

     

    Add a Get Message Details action to your flow. You'll need the message ID from a message.

    creativeopinion_1-1717422258171.png

    You can get this from a previous flow run. Scroll down in the outputs and locate the id. 

    creativeopinion_2-1717422303267.png

    Run a test. Review the outputs. Scroll down till you see the mentions.

     creativeopinion_6-1717422550829.png

     

    Get Mentioned Users

    Unfortunately, the Get message details action doesn't output dynamic content for the mentioned users. You'll need to use an expression. 

     

    Add a Compose action to store the mentioned users. Tip: Rename your actions to keep your flow organized. Insert an expression and start with:

    ?['mentions']

    creativeopinion_4-1717422441903.png

    Click on the Dynamic Content tab and insert the body dynamic content from the Get message details action.

    creativeopinion_5-1717422455373.png

    Run a test. The Compose action will output an array of mentioned text. Note: The first and last name are output as separate items.

    creativeopinion_11-1717387196108.png

    creativeopinion_7-1717422749073.png

     

    Select User IDs

    Add a Select action. In the From field, insert the output from the Compose action above. Click on the icon to switch the Map mode.

    creativeopinion_4-1717387026425.png

    In the map field, insert an expression.

    item()?['mentioned/user/id']

    creativeopinion_8-1717422949889.png

     

    creativeopinion_9-1717423004233.png

     

    Run a test. Review the outputs. You'll notice that each ID is duplicated. This is because the user's first name and last name are output as separate array items. The ID is the same for both (as they are the same user).

    creativeopinion_8-1717387159276.png

     

    Output Unique IDs

    Add a Compose action to store the unique user ID's. To get the unique IDs you'll need to use an expression. Insert the union() function. The union() function takes two arrays and combines them into one while removing duplicate values.

    union([array 1],[array2])

    creativeopinion_12-1717387238198.png

    Click on the Dynamic content tab and insert the output from the Select action. Add a Comma and insert the output from the Select action again.

    creativeopinion_13-1717387255838.png

    The final expression should look something like this. Keep in mind, if you've renamed your Select action it will be a little different.

    creativeopinion_14-1717387273283.png

    Run a test. Review the outputs. You should have an array of unique IDs.

    creativeopinion_15-1717387295555.png

    Convert Array to String

    The Create a task action requires a semi-colon separated ids or email addresses of users to assign to a task.

    creativeopinion_10-1717423338458.png

     

    To convert the array of user ids to a semi-colon separated string, use the Join action. In the From field, insert the output from the Compose action. 

     

    In the Join with field, insert a semi-colon.

    creativeopinion_16-1717387406545.png

    Run a test. Review the outputs the array will output as a string.

    creativeopinion_11-1717423487153.png

    You can now insert the output from the Join action into the Create a task action.

    creativeopinion_12-1717423574191.png

     

    Replace Trigger

    As mentioned earlier, I would recommend keeping a copy of your manually triggered flow. Create a copy of your flow and replace the manual trigger with the automated trigger. Instead of hardcoding the Message Id, insert the Message id dynamic content from the flow trigger.

    creativeopinion_13-1717423755951.png

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Trying to create a flow that assigns a new task to the mentioned user in the body text of a new post in a channel, as well as label the task according to keywords used.

    @Dipsy It's hard to see the text in your screenshot. However, what you have here in this Compose action is a string (not an expression).

     

    You need to insert an expression. If you aren't sure how to insert an expression—refer to this section of my YT tutorial: 7 Functions You Need to Know | ️Expression Essentials: Part 1

     

    In this section, I'll cover how to get dynamic content with an expression when the dynamic content you need isn't listed in the dynamic content menu.

     

    In the full tutorial I cover 7 functions you need to know when getting started with expressions.

    1️⃣ empty()

    2️⃣ coalesce()

    3️⃣ equals()

    4️⃣ if()

    5️⃣ concat()

    6️⃣ length()

    7️⃣ split()

     

    I cover how to use these functions in expressions and I’ll also cover common mistakes when it comes to writing expressions and show you a few tips and tricks along the way.

     

    As a beginner or even an intermediate flow builder—expressions can seem a bit complex at first, I’m going to try to simplify it for you. If you want to level up your flows by writing expressions—keep watching!

     

    IN THIS VIDEO:

     What is an Expression?

     What is a Function?

     What Does Wrapping a Function Mean?

     How Do I Insert an Expression?

     How to Use a Compose action

     How to Navigate the Expression Builder with Arrow Keys

     How to use the Expression Tooltip

     Common Mistakes When Writing Expressions

     How to differentiate a null from an empty string

     How to Get Dynamic Content When it’s Not Listed

     How to Use a Get Item Action to Verify Dynamic Content Output

     How to Convert Strings to Lower Case

     How to Troubleshoot the if() Function

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1