@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.

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

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

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']

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

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


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.

In the map field, insert an expression.
item()?['mentioned/user/id']


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).

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])

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.

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

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

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.

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.

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

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

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.

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