Skip to main content

Notifications

Community site session details

Community site session details

Session Id : zAIsdJJ9oqVX30elHW6kbS
Power Apps - Building Power Apps
Answered

I need to add @ mention to Teams from my powerapps form

Like (0) ShareShare
ReportReport
Posted on 12 Jun 2024 16:21:59 by

Here is my formula to send a message to teams but my Nominee Name, Nominee Manager & Submitter Manager is not getting a notification message on teams or tag.

 

 

 


////Send Message to Teams/////

MicrosoftTeams.PostMessageToChannelV3(
    "c7154dcd-2cb3-4383-b2bd-e45dcd09b205",/// GroupID
    "19:dsLOTCD17xGIDSqGQJlCSYFxELx6tHg-NeAUMob3Y881@thread.tacv2",/// ChannelID
   {
        content: "Nominee Name: " & DataCardValue45.Selected.DisplayName & "<br>" &
                 "Nominee Manager: " & DataCardValue2.Selected.DisplayName & "<br>" &
                 "Submitter Manager: " & DataCardValue4.Selected.DisplayName,
        contentType: "Html"
    }
);


Can someone help make this formula add this function above or show me a better way with the power flow?
  • Verified answer
    v-yueyun-msft Profile Picture
    on 19 Jun 2024 at 02:20:24
    Re: I need to add @ mention to Teams from my powerapps form

    Hi , @Kumar09 

    Thanks for your response!

    I mean, you need to get the email or id of this user. For example, we can use the Person type column of SharePoint to get the corresponding email.

    If your data source only saves the user's DisplayName, then you need to get the user's email through DisplayName.

    For example, you can use Office 365User connector to search the user's email.

    vyueyunmsft_0-1718763603316.png

     

    First( Office365Users.SearchUserV2({searchTerm:"Your DisplayName" , isSearchTermRequired:true } ).value ).Mail
     
     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • Kumar09 Profile Picture
    on 18 Jun 2024 at 18:52:16
    Re: I need to add @ mention to Teams from my powerapps form

    This process exactly: 

     

    If you don't have an email in your items property, you'll need to add the corresponding email to your data source. Because of DisplayName alone, the backend can't identify who this person really is.

     

     

    How do I make that happen on my side?

     

    Can you please help @v-yueyun-msft 

  • Kumar09 Profile Picture
    on 18 Jun 2024 at 18:48:03
    Re: I need to add @ mention to Teams from my powerapps form

    @v-yueyun-msft  

    Oh, okay, so where do I put my exact information about the email? Can you provide a step-by-step process? 

  • v-yueyun-msft Profile Picture
    on 14 Jun 2024 at 03:09:50
    Re: I need to add @ mention to Teams from my powerapps form

    Hi , @Kumar09 

    Thanks for your response! Dose your DataCardValue Control -  items property contains the user email in your side?

    If this , you can directly try to use this code:

     

    MicrosoftTeams.PostMessageToChannelV3(
    "c7154dcd-2cb3-4383-b2bd-e45dcd09b205",/// GroupID
    "19:dsLOTCD17xGIDSqGQJlCSYFxELx6tHg-NeAUMob3Y881@thread.tacv2",/// ChannelID
    {
    content: "Nominee Name: <at>" & DataCardValue45.Selected.Email & "</at><br>" &
    "Nominee Manager: <at>" & DataCardValue2.Selected.Email & "</at><br>" &
    "Submitter Manager: <at>" & DataCardValue4.Selected.Email & "</at>",
    contentType: "Html"
    }
    );

     

    If you don't have an email in your items property, you'll need to add the corresponding email to your data source. Because of DisplayName alone, the backend can't identify who this person really is.

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

  • Kumar09 Profile Picture
    on 13 Jun 2024 at 16:20:50
    Re: I need to add @ mention to Teams from my powerapps form

    @v-yueyun-msft  

    Thank you for replying to my request:

    So, this is my current code:

     

    MicrosoftTeams.PostMessageToChannelV3(
    "c7154dcd-2cb3-4383-b2bd-e45dcd09b205",/// GroupID
    "19:dsLOTCD17xGIDSqGQJlCSYFxELx6tHg-NeAUMob3Y881@thread.tacv2",/// ChannelID
    {
    content: "Nominee Name: " & DataCardValue45.Selected.DisplayName & "<br>" &
    "Nominee Manager: " & DataCardValue2.Selected.DisplayName & "<br>" &
    "Submitter Manager: " & DataCardValue4.Selected.DisplayName,
    contentType: "Html"
    }
    );

     

     

    How would I add this part (<at>userid</at>   OR   <at>useremail</at>) without removing anything above from my code? 

     

    Also, my Nominee Name, Nominee Manager, and Submitter Manager will change everything. Someone in my company uses the spot award app, so will the <at>userid</at> OR <at>useremail</at> work?

  • v-yueyun-msft Profile Picture
    on 13 Jun 2024 at 01:41:29
    Re: I need to add @ mention to Teams from my powerapps form

    Hi , @Kumar09 

    If you want to pass the @mention to your Teams channel , you need to pass this :

    <at>userid</at>   OR   <at>useremail</at>

     

    This is my test code and the result is as follows:

    vyueyunmsft_0-1718242835126.png

    vyueyunmsft_1-1718242850683.png

     

    MicrosoftTeams.PostMessageToChannelV3("Group ID","Channel ID",
    {content : "Nominee Name: <at>User Email / User ID</at> " ,contentType :"Html"})
     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started