
Announcements
I've built a mentor matching app that allows the user to find and connect with someone. Once the user has selected the mentor they want, we want to encourage them to setup a 1-1 chat in Teams and put a meeting (Teams) in the diary between the two of them. I want to enable this through the app.
The user is the current logged in user and the mentor selected is held in the Mentor_DataCard3 field in the screen (People field from sharepoitn list) . I've tried the following code to start a 1-1 chat but it errors out
It doesn't need to do it within the app. Just opening up the chat dialogue in Teams and / or openign up a meeting invite in Teams between the 2 attendees with a title will do.
MicrosoftTeams.CreateChat(DataCardValue28.Selected.Email)
Any ideas how I can get the chat and hopefully the meeting working?
Hi,
With the help of power automate you can create 1:1 chat. The flow will accept mentoremail address as an input from canvas app & return the weblink of the ms teams chat. In the app, you can use html text control to show the chat link and when user clicks it, it will be redirected to MS teams chat.
First create a power automate flow as shown below:
Add the power automate in canvas app and call it on button click using the below formula, passing the mentor email as input parameter and storing the output parameter in a local variable:
UpdateContext({varChatlink:Create1to1Chat.Run(DataCardValue28.Selected.Email).meetingweblink});
Next, use html text control to show the link to the user and the following in the HtmlText property:
"<a href='" & varChatlink & "'>Click to Chat</a>"
when user clicks on the link, it will be redirected to MS team chat (web or app).
please let me know if you need more details.
Please remember to give a 👍 and accept my solution as it will help others in the future.
thanks