web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Posting Form entry to ...
Power Apps
Answered

Posting Form entry to Teams

(0) ShareShare
ReportReport
Posted on by 19

Hi,

My scenario is that I have a Form with multiple fields that updates a gallery and SP list upon submission. I want to be able to post that same entry to Teams if a checkbox is selected with the same submit button, all at once. I have 2 dropdowns sorted already to select where to post the message.

 

-How do I code the Submit button on my form entry to also include the multiple-text box (or single form entry) to Teams when/if a checkbox is submitted?

 

Current Submit Button coding: SubmitForm(Form1); NewForm(Form1)

Current Post-to-Teams coding (I have this working on a different button right now for testing...): MicrosoftTeams.PostMessageToChannel(Teams_Dropdown1.SelectedText.id,Teams_Dropdown2.SelectedText.id,{body:{content:DataCardValue4.Text,contentType:0}})

 

I would appreciate any pointers or help. Thanks much!

 

 

Categories:
I have the same question (0)
  • KrishnaV Profile Picture
    5,023 on at

    Hi @SL18 ,

     

    See this beautiful article talking about all the operations of the Teams:
    http://www.ludovicperrichon.com/powerapps-how-to-interact-with-teams/

     

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

     

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

     

  • v-yutliu-msft Profile Picture
    on at

    Hi @SL18 ,

    Do you want to submit a record and send this record to teams (if the checkbox is selected) by clicking a button?

    If so, firstly you just need to use an if statement to justify whether post to teams.

    Secondly, you could use formname.Updates to represent all the data in the form.

    Try this:
    set the submit button's OnSelect:

    If(Checkbox1.Value,
     MicrosoftTeams.PostMessageToChannel(
     Teams_Dropdown1.SelectedText.id,Teams_Dropdown2.SelectedText.id,
     {body: 
     {content:Concat(Form1.Updates,
     "field1:"&field1&",field2:"&field2",field3:"&field3
     ),
     contentType:0
     }
     };
     SubmitForm(Form1),
     SubmitForm(Form1)
    )

    //if the checkbox value is true you will send the message to teams and submit the form. If the checkbox value is false, you will only submit the form.

    What's more the message's content should be text, so I use Concat to transfer form.Updates to text.

    Please replace with your control name, fieldname.

     

     

     

    Best regards,

  • SL18 Profile Picture
    19 on at

    This seems so much closer than I was getting with it, but I'm still not able to make it work. I get:

    The function 'Concat' has some invalid arguments.

    Invalid number of arguments: received 4, expected 3.

     

    I replaced the field names with my field names.

     

    Any thoughts?

  • KrishnaV Profile Picture
    5,023 on at

    Try this one first:

    MicrosoftTeams.PostMessageToChannel(
     Teams_Dropdown1.SelectedText.id,Teams_Dropdown2.SelectedText.id,
     {body: 
     {content:"Smple Content",contentType:0}
     });



    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

     

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • SL18 Profile Picture
    19 on at

    @KrishnaV 

    I had similar to this, but my issue is that in the content of the message, I need it to be pulled from either a Form entry (with 3 fields), or multiple text boxes. I can get the function to work with a single text box but don't know the logic to get more.

     

    Thanks for trying to help me. Let me know if you have any more thoughts on it.

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @SL18 ,

     

    This worked for me:

     

    MicrosoftTeams.PostMessageToChannel(
     txtTeamID.Text,txtChannelID.Text,
     {body: 
     {content:Concatenate(txtValue1.Text,"--",txtValue2.Text,"--",txtValue3.Text),contentType:0}
     });

     

     

    Team Message.png

    I just changed Concat with Concatenate , hope this helps.

     

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • SL18 Profile Picture
    19 on at

    @KrishnaV @v-yutliu-msft 

     

    Thank you both!!

     

    I really appreciate the help. I was able to combine both for a working solution. Thanks again.

     

    SL18

  • mbhatt Profile Picture
    525 on at

    hello @KrishnaV 

     

    i have similar issue 

    what if i have to post message to created by user from powerapp 

    i have view form screen i have chat box with html viewer as  well and i want to send message to created by user when i comment something  on chat box how ro i send this chat box with data to user teams and how user will replay on same ? with the same comment data i want on my teams when user replay 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard