<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Microsoft 365</title>
    <description>The latest articles on DEV Community by Microsoft 365 (@microsoft365).</description>
    <link>https://dev.to/microsoft365</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2656%2Ff8ee466a-d34d-4ce4-b801-ad44af80c96b.png</url>
      <title>DEV Community: Microsoft 365</title>
      <link>https://dev.to/microsoft365</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/microsoft365"/>
    <language>en</language>
    <item>
      <title>Join us for HackTogether: The Microsoft Teams Global Hack</title>
      <dc:creator>Garry Trinder</dc:creator>
      <pubDate>Thu, 11 May 2023 14:40:00 +0000</pubDate>
      <link>https://dev.to/microsoft365/join-us-for-hacktogether-the-microsoft-teams-global-hack-4p15</link>
      <guid>https://dev.to/microsoft365/join-us-for-hacktogether-the-microsoft-teams-global-hack-4p15</guid>
      <description>&lt;p&gt;Millions of people across the globe use Microsoft Teams at work and at school. It is one of the world’s most popular collaboration and communication platforms with more than 300 million monthly active users. But did you know that you can build apps that can run inside or extend Microsoft Teams features?&lt;/p&gt;

&lt;p&gt;Join us for &lt;strong&gt;HackTogether: The Microsoft Teams Global Hack&lt;/strong&gt;, our virtual hackathon to learn how to build powerful apps for Microsoft Teams. Join live events, connect with Microsoft experts and win awesome prizes!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/TCjWqcQkj7w"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The hackathon opens on &lt;strong&gt;June 1, 2023&lt;/strong&gt; with our live keynote. &lt;a href="https://aka.ms/hack-together-teams"&gt;Register&lt;/a&gt; and start hacking on your project, alone or with a team. Submit your project before the event closes on &lt;strong&gt;June 15, 2023&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Not sure how to build apps for Microsoft Teams? Don’t worry, we have you covered! We will provide help and support every step of the way with live events and a chance to connect with Microsoft experts.&lt;/p&gt;

&lt;p&gt;If you’re a beginner, a student, or experienced developer interested in learning a new skill or just want to showcase your existing skills, make sure that you don’t miss this opportunity!&lt;/p&gt;

&lt;h2&gt;
  
  
  Join live events 📺
&lt;/h2&gt;

&lt;p&gt;We will host live events throughout the hackathon to inspire you with ideas and provide access to learning resources to help you on your app building journey.&lt;/p&gt;

&lt;p&gt;Join Microsoft experts as they share the why, what, and how of building apps for Microsoft Teams.&lt;/p&gt;

&lt;p&gt;Schedule of live events:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;June 1st:  Ready, Set, Hack: Empower the developer in you with Microsoft Teams app development!&lt;/li&gt;
&lt;li&gt;June 5th:  Introduction to Teams tabs and building them with SharePoint Framework: Maximize Microsoft 365 investments.&lt;/li&gt;
&lt;li&gt;June 6th:  Introduction to Teams bots: Integrating AI into your bot logic.&lt;/li&gt;
&lt;li&gt;June 7th:  Boost user engagement beyond Teams with message extensions and make your app intelligent using Microsoft Graph.&lt;/li&gt;
&lt;li&gt;June 12th: Ask the experts: Meet our engineering team and ask your pressing questions!&lt;/li&gt;
&lt;li&gt;June 15th: Wrap up and take action: Join our community for the next Big Thing!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Be sure to add these events to your calendar using our invite, so that you don’t miss out!&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect with Microsoft experts 💬
&lt;/h2&gt;

&lt;p&gt;If you need help or get stuck, ask a question in our Discussions forum and connect with Microsoft experts who will be on hand to help you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Win awesome prizes! 🏆
&lt;/h2&gt;

&lt;p&gt;Once the event closes, we will judge all entries and announce the winners.&lt;/p&gt;

&lt;p&gt;Prizes will be awarded in the following categories:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🏆 Grand prize winner: The best of the best!&lt;/strong&gt; This category rewards the solution that meets all judging criteria, wows judges, and has potential real-world value for the 300M Teams users.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Xbox 🎮&lt;/li&gt;
&lt;li&gt;$300 digital gift card 💸&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best AI-powered solution.&lt;/strong&gt; This category rewards the solution that integrates AI or machine learning in an innovative way. For example, a chatbot that automates common tasks in Teams or an app that uses AI to suggest relevant files for users.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$300 digital gift card 💸&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🥇 Best productivity-focused solution.&lt;/strong&gt; This category rewards the solution that facilitates productivity and collaboration within Teams. For example, extending an existing app to Teams or creating a custom solution that helps team members stay organized during meetings.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$300 digital gift card 💸&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🥇 Community hack winner.&lt;/strong&gt; This category rewards the solution chosen by our guest judges at European Collaboration Summit (ECS).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C64 retro computer 🖥️&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How do I get started? 🚀
&lt;/h2&gt;

&lt;p&gt;HackTogether: The Microsoft Teams Global Hack is a unique opportunity to challenge yourself, learn new skills, and showcase your talent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aka.ms/hack-together-teams"&gt;Register&lt;/a&gt; today! We can’t wait to see what you build!&lt;/p&gt;

&lt;p&gt;This hackathon is run in partnership with &lt;a href="https://aka.ms/community/home"&gt;Microsoft 365 &amp;amp; Power Platform Community&lt;/a&gt; and the &lt;a href="https://www.collabsummit.eu/"&gt;European Collaboration Summit&lt;/a&gt; community. Learn more about Microsoft Teams development. Visit our &lt;a href="https://developer.microsoft.com/microsoft-teams"&gt;Microsoft Teams Dev Center&lt;/a&gt; and follow us on &lt;a href="https://twitter.com/Microsoft365Dev"&gt;(@Microsoft365Dev) / Twitter&lt;/a&gt; to stay on top of our news and announcements.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>javascript</category>
      <category>dotnet</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Learn how to develop apps for Microsoft Teams using Teams Toolkit for Visual Studio Code video series</title>
      <dc:creator>Garry Trinder</dc:creator>
      <pubDate>Thu, 27 Apr 2023 12:59:00 +0000</pubDate>
      <link>https://dev.to/microsoft365/learn-how-to-develop-apps-for-microsoft-teams-using-teams-toolkit-for-visual-studio-code-video-series-17oe</link>
      <guid>https://dev.to/microsoft365/learn-how-to-develop-apps-for-microsoft-teams-using-teams-toolkit-for-visual-studio-code-video-series-17oe</guid>
      <description>&lt;p&gt;Are you a developer looking to start creating apps for Microsoft Teams?&lt;/p&gt;

&lt;p&gt;We are delighted to share with you the &lt;a href="https://www.youtube.com/playlist?list=PLR9nK3mnD-OUj_N95-MsO0kcuufOzRTTh"&gt;Build and deploy apps for Microsoft Teams using Teams Toolkit for Visual Studio Code&lt;/a&gt; video playlist.&lt;/p&gt;

&lt;p&gt;Teams Toolkit for Visual Studio Code is a tool for building apps for Microsoft Teams, fast. &lt;/p&gt;

&lt;p&gt;It is the quickest way to create, build, debug, test, and deploy apps for Microsoft Teams.&lt;/p&gt;

&lt;p&gt;This playlist teaches you basic concepts of building apps for Microsoft Teams using Teams Toolkit.&lt;/p&gt;

&lt;p&gt;You will learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get started&lt;/li&gt;
&lt;li&gt;Build a bot&lt;/li&gt;
&lt;li&gt;Build a tab&lt;/li&gt;
&lt;li&gt;Use Teams JavaScript library&lt;/li&gt;
&lt;li&gt;Deploy your app to Azure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy coding! 👋&lt;/p&gt;

&lt;p&gt;Full playlist URL: &lt;a href="https://www.youtube.com/playlist?list=PLR9nK3mnD-OUj_N95-MsO0kcuufOzRTTh"&gt;https://www.youtube.com/playlist?list=PLR9nK3mnD-OUj_N95-MsO0kcuufOzRTTh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/tOoEnTqlG60"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;All videos in the playlist were recorded in the weekly Microsoft 365 Platform and Power Platform community call. Learn more: &lt;a href="https://aka.ms/community/calls"&gt;https://aka.ms/community/calls&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>microsoft365dev</category>
      <category>gettingstarted</category>
      <category>microsofteams</category>
    </item>
    <item>
      <title>Teams Toolkit Cloud Skills Challenge - build apps for Microsoft Teams!</title>
      <dc:creator>Luise Freese</dc:creator>
      <pubDate>Wed, 19 Apr 2023 10:46:42 +0000</pubDate>
      <link>https://dev.to/microsoft365/teams-toolkit-cloud-skills-challenge-build-apps-for-microsoft-teams-3378</link>
      <guid>https://dev.to/microsoft365/teams-toolkit-cloud-skills-challenge-build-apps-for-microsoft-teams-3378</guid>
      <description>&lt;p&gt;👋 Hey, fellow developers!&lt;/p&gt;

&lt;p&gt;You like to #NeverStopLearning and feel that #SharingIsCaring? Then this here is exactly for you! We started a new Cloud Skills challenge about Teams Toolkit last week - and we are overwhelmed by the positive response. &lt;/p&gt;

&lt;p&gt;It is an amazing opportunity to take your app development skills to the next level!&lt;/p&gt;

&lt;h2&gt;
  
  
  Join us!
&lt;/h2&gt;

&lt;p&gt;Join us from April 12 to April 26 and participate in the challenge to complete the learn path &lt;a href="https://aka.ms/LearnTeamsToolkit"&gt;aka.ms/LearnTeamsToolkit&lt;/a&gt;.&lt;br&gt;
Not only will you enhance your skills to develop apps for Teams, but you will also be eligible to win fab prizes. The following prizes will be awarded: Ten (10) Grand Prize winners. Each winner will receive the choice of either a $100 digital gift card or $100 Azure credits. Approximate Retail Value (ARV) $1000.&lt;/p&gt;

&lt;p&gt;By completing the learn path, you will learn how to leverage Teams Toolkit, a Visual Studio Code extension to build apps for Teams, covered by five modules:&lt;/p&gt;

&lt;p&gt;✅ Get started building apps for Microsoft Teams by using Teams Toolkit for Visual Studio Code&lt;br&gt;
✅ Build a bot by using Teams Toolkit for Visual Studio Code&lt;br&gt;
✅ Build a Microsoft Teams tab app by using Teams Toolkit for Visual Studio Code&lt;br&gt;
✅ Add chat to a Microsoft Teams app by using the Teams JavaScript client library&lt;br&gt;
✅ Deploy a Microsoft Teams app to Azure by using Teams Toolkit for Visual Studio Code&lt;br&gt;
With that, they provide a comprehensive and in-depth experience that covers everything you need to know to get started building apps for Teams.&lt;/p&gt;

&lt;p&gt;With Teams Toolkit, you can streamline the app development process and make the most of the platform’s features, including creating bots that can automate tasks, developing tabs that can display information from external services, and building message extensions that enable users to interact with external services from within Teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributing
&lt;/h2&gt;

&lt;p&gt;What’s more, once you completed the challenge, you will have the opportunity to contribute to the community by creating samples and getting featured on &lt;a href="https://adoption.microsoft.com"&gt;adoption.microsoft.com&lt;/a&gt;. This way, you can showcase your skills, help others, and become a recognized member of the community.&lt;/p&gt;

&lt;p&gt;Don’t miss this incredible opportunity to enhance your skills and join the Teams Toolkit Cloud Skills Challenge.&lt;/p&gt;

&lt;p&gt;We can’t wait to see what you create!&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get started
&lt;/h2&gt;

&lt;p&gt;✅ Register for the challenge and complete the learn path aka.ms/LearnTeamsToolkit&lt;br&gt;
✅ Post on Twitter or LinkedIn about it using the hashtag #LearnTeamsToolkit&lt;br&gt;
✅ Tag me Luise Freese | &lt;a class="mentioned-user" href="https://dev.to/luisefreese"&gt;@luisefreese&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Registration house-keeping
&lt;/h2&gt;

&lt;p&gt;When you register make sure to check the official rules link, and take the survey. This will make you compliant for winning prizes. Once the survey form is filled out, select the check box to agree to the rules and proceed to register by selecting the Continue button.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-fundamentals?pivots=visual-studio-code"&gt;Teams Toolkit Overview&lt;/a&gt;&lt;br&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension"&gt;Teams Toolkit on VS Code Marketplace&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>microsoft</category>
      <category>teams</category>
    </item>
    <item>
      <title>How to create apps for Microsoft Teams</title>
      <dc:creator>Rabia Williams</dc:creator>
      <pubDate>Mon, 06 Feb 2023 00:18:18 +0000</pubDate>
      <link>https://dev.to/microsoft365/how-to-create-apps-for-microsoft-teams-2l9e</link>
      <guid>https://dev.to/microsoft365/how-to-create-apps-for-microsoft-teams-2l9e</guid>
      <description>&lt;p&gt;As Microsoft Teams becomes increasingly popular as a collaboration platform, demand for developers who can build apps for Teams has skyrocketed. Learning how to build apps for Teams can open up new career opportunities for you as a developer.&lt;/p&gt;

&lt;p&gt;If you are looking for a free beginner course to learn how to build apps for Teams, look no further. We have a new &lt;a href="//aka.ms/learn/teamstoolkit"&gt;learning path&lt;/a&gt; which will take you on a journey to build apps for Teams.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension" rel="noopener noreferrer"&gt;Teams Toolkit&lt;/a&gt;, an extension for Visual Studio Code, will be used in the course, to help you create, test, and deploy Microsoft Teams apps with ease.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faicx2le45qm05bl31n99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faicx2le45qm05bl31n99.png" alt=" Teams Toolkit doodle showing the features like develop app in VS Code, local debug, provision etc" width="582" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, what are you waiting for? Go to &lt;a href="//aka.ms/learn/teamstoolkit"&gt;aka.ms/learn/teamstoolkit&lt;/a&gt; to take the course.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://devblogs.microsoft.com/microsoft365dev/learn-how-to-develop-apps-for-microsoft-teams-using-teams-toolkit-in-visual-studio-code/" rel="noopener noreferrer"&gt;Read more about the course here&lt;/a&gt;&lt;br&gt;
👀&lt;a href="https://www.youtube.com/watch?v=vzmpJKMBOKk0" rel="noopener noreferrer"&gt;Watch our video to get an overview of the course&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devto</category>
      <category>offers</category>
    </item>
    <item>
      <title>Control Microsoft Teams with a Stream Deck</title>
      <dc:creator>Jim Bennett</dc:creator>
      <pubDate>Thu, 02 Feb 2023 00:00:00 +0000</pubDate>
      <link>https://dev.to/microsoft365/control-microsoft-teams-with-a-stream-deck-37io</link>
      <guid>https://dev.to/microsoft365/control-microsoft-teams-with-a-stream-deck-37io</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Already have a Stream Deck and just want to get it working with Teams? Jump to the instructions to set this up&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Like a lot of folks, I spend time in Microsoft Teams. It’s where I chat to my team and others at Microsoft, and it’s where I take most of my meetings.&lt;/p&gt;

&lt;p&gt;Although Teams has a lot of good features, the UI can sometimes be a pain to use in meetings - especially as a Microsoft employee where we get to try the dogfood versions and things move all the time. There have been loads of occasions where I have tried to give a reaction and put up my hand by mistake, or tried to mute and left the call. WHat I really need is a tool to allow me to control teams without using the UI.&lt;/p&gt;

&lt;p&gt;Makers have worked on hacks for this. For example, the key combination &lt;code&gt;ctrl+shift+m&lt;/code&gt; toggles muting on teams. Add a big red button that simulates this key press and you have a quick way to mute or unmute. Here’s one example of this from &lt;a href="https://www.hackster.io/jenfoxbot/microsoft-teams-mute-button-7e9186" rel="noopener noreferrer"&gt;Jen Fox on Hackster&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackster.imgix.net%2Fuploads%2Fattachments%2F1234030%2F_5g18grpTco.blob%3Fauto%3Dcompress%252Cformat%26w%3D900%26h%3D675%26fit%3Dmin" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhackster.imgix.net%2Fuploads%2Fattachments%2F1234030%2F_5g18grpTco.blob%3Fauto%3Dcompress%252Cformat%26w%3D900%26h%3D675%26fit%3Dmin" alt="A white box with a big red button on top with a hand about to press the button. On the front of the bix is a circuit playground express with crocodile clips connecting it to the white box. In the background is a laptop showing a Microsoft teams meeting" width="900" height="675"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For those with a less maker mindset, there’s now a new way to do this - using a Stream deck!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88lwe72q60xcerscmxp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88lwe72q60xcerscmxp4.png" alt="A stream deck with Teams buttons" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’ve not come across a Stream Deck before, its a neat little gadget that comes in different sizes and has an array of LCD buttons. You can set these buttons up to do things like control apps, or make REST requests, and as each button is an LCD screen you can fully customize what is displayed. For example, you can use one of these to control apps like OBS to switch scenes, or start streaming to Twitch.&lt;/p&gt;

&lt;p&gt;There’s a whole Stream Deck store with plugins to extend the capabilities by controlling other apps or hardware (such as Phillips Hue lights). A Teams plugin has just been released!&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up your Stream Deck for Teams
&lt;/h2&gt;

&lt;p&gt;To set up the Stream Deck, you need an API key for Teams to allow external apps to control it - makes sense really as Teams gives access to confidential work stuff, so you don’t want any app to be able to get access. Then you install the plug in, and set it up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get an API key
&lt;/h3&gt;

&lt;p&gt;To get an API key:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select the ellipses from the top-right corner of Teams, then select &lt;strong&gt;Settings&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbwir705xnqsj05pof6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbwir705xnqsj05pof6x.png" alt="The settings menu in Teams under the ellipses" width="346" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select the &lt;em&gt;Privacy&lt;/em&gt; tab, then scroll down to the &lt;em&gt;Third-party app API section&lt;/em&gt; and select &lt;strong&gt;Manage API&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxeaddmkzp9r31kx5mqel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxeaddmkzp9r31kx5mqel.png" alt="The privacy tab" width="664" height="746"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the API settings, copy the API token. Use the &lt;strong&gt;Generate&lt;/strong&gt; button to generate a new API key if needed. And yes, the UI is terrible and the key wraps out of the text box… 🤷&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4edmkt0ell4n59dj8iba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4edmkt0ell4n59dj8iba.png" alt="The Teams API key dialog" width="572" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you have your key, you can set up your Stream Deck!&lt;/p&gt;

&lt;h3&gt;
  
  
  Set up the Stream Deck
&lt;/h3&gt;

&lt;p&gt;Teams is managed from a plugin from the Stream Deck store.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Stream Deck store from the menu/taskbar icon&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8csygywp4u02ptfrs7zu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8csygywp4u02ptfrs7zu.png" alt="The store menu item" width="264" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for Teams in the store, and install the Microsoft Teams plugin with the &lt;strong&gt;install&lt;/strong&gt; button&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdn6xwtrnktvd4jip19fd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdn6xwtrnktvd4jip19fd.png" alt="The Teams item in the store" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once installed, configure your Stream Deck using the Teams options. I did mine by creating a new profile that is activated when Teams is active.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9cojp1hnqagtvkpsf3vv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9cojp1hnqagtvkpsf3vv.png" alt="Stream deck configuration showing a profile called Teams that is set to activate when Microsoft Teams is active" width="616" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once your profile is ready, select it then add buttons by dragging them from the Microsoft Teams group in the menu. After adding each button, you will need to set the &lt;em&gt;API token&lt;/em&gt; field to the API key you copied from Teams.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ik14m2vixeylgxeurzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ik14m2vixeylgxeurzg.png" alt="Stream deck configuration showing a profile called Teams that is set to activate when Microsoft Teams is active" width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done! You can now control Teams using your Stream Deck.&lt;/p&gt;




&lt;p&gt;Be sure to follow me for more cool posts!&lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__113783"&gt;
    &lt;a href="/jimbobbennett" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F113783%2Fff54a8a6-ef4c-4b98-aa6e-339db4cd548a.jpg" alt="jimbobbennett image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/jimbobbennett"&gt;Jim Bennett&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/jimbobbennett"&gt;Head of Developer Advocacy at Pieces&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>teams</category>
      <category>streamdeck</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>🙋🤖 Place your order! - Build bots for Microsoft Teams to automate repetitive workflows using Teams Toolkit for VS Code</title>
      <dc:creator>Garry Trinder</dc:creator>
      <pubDate>Tue, 06 Dec 2022 12:20:00 +0000</pubDate>
      <link>https://dev.to/microsoft365/place-your-order-build-bots-for-microsoft-teams-to-automate-repetitive-workflows-using-teams-toolkit-for-vs-code-13l8</link>
      <guid>https://dev.to/microsoft365/place-your-order-build-bots-for-microsoft-teams-to-automate-repetitive-workflows-using-teams-toolkit-for-vs-code-13l8</guid>
      <description>&lt;p&gt;Imagine the scenario that your organisation wants to make it easier for employees to place orders at the company restaurant.&lt;/p&gt;

&lt;p&gt;As your organisation is already a heavy user of Microsoft Teams, it makes sense to build an app and surface it where your employees spend most of their working day.&lt;/p&gt;

&lt;p&gt;Placing an order at a restaurant is a simple repetitive task. Typically, the process goes like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Employee asks to make an order.&lt;/li&gt;
&lt;li&gt;Restaurant responds with the menu.&lt;/li&gt;
&lt;li&gt;Employee places their order based on the menu options.&lt;/li&gt;
&lt;li&gt;Restaurant confirms and works on the order.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Developing a bot for Microsoft Teams, rather than a traditional web application, is a great way of implementing this type of workflow inside Microsoft Teams through a conversational interface.&lt;/p&gt;

&lt;p&gt;In this tutorial, I'm going to walk you through the steps of how to use &lt;a href="https://learn.microsoft.com/microsoftteams/platform/toolkit/teams-toolkit-fundamentals?WT.mc_id=m365-79415-garrytrinder"&gt;Teams Toolkit for Visual Studio Code&lt;/a&gt; to create a Microsoft Teams app that contains a bot that the employees can use to place orders with the restaurant.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4KBtnQ4_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k27a1jkdwl57k6cgkp04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4KBtnQ4_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k27a1jkdwl57k6cgkp04.png" alt="Order command response" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to see the finished version, checkout the sample in the gallery, or the &lt;a href="https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/place-your-order-workflow-bot"&gt;final source code&lt;/a&gt; on the TeamsFx GitHub repository.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🎥 A recording from the weekly &lt;a href="https://pnp.github.io"&gt;Microsoft 365 Platform Community&lt;/a&gt; call is available, &lt;a href="https://youtu.be/rQIXOo0BevM"&gt;Build your first Workflow bot for Microsoft Teams with Teams Toolkit for Visual Studio Code&lt;/a&gt;, which covers the steps discussed in this tutorial.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Teams Toolkit for Visual Studio Code&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Install Teams Toolkit for Visual Studio Code&lt;/li&gt;
&lt;li&gt;Scaffold and run the project&lt;/li&gt;
&lt;li&gt;Clean the project&lt;/li&gt;
&lt;li&gt;Create the Adaptive Card templates&lt;/li&gt;
&lt;li&gt;Create the order command&lt;/li&gt;
&lt;li&gt;Create the order card action&lt;/li&gt;
&lt;li&gt;Place your order&lt;/li&gt;
&lt;li&gt;What next?&lt;/li&gt;
&lt;li&gt;Learn more&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="ttk"&gt;🛠 Teams Toolkit for Visual Studio Code&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/microsoftteams/platform/toolkit/teams-toolkit-fundamentals?WT.mc_id=m365-79415-garrytrinder"&gt;Teams Toolkit for Visual Studio Code&lt;/a&gt; enables you to create, debug and deploy Microsoft Teams apps to a Microsoft 365 tenant fast using a no configuration approach.&lt;/p&gt;

&lt;p&gt;In a recent release of Teams Toolkit for Visual Studio Code, a new scenario-based app capability has been released called &lt;em&gt;Initiate sequential workflows&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This new capability makes it easy for developers to respond to actions invoked from Adaptive Cards, which is ideal for our restaurant order scenario.&lt;/p&gt;

&lt;p&gt;Using this new capability, we will create a bot that uses the below workflow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The employee sends a message containing the word &lt;em&gt;order&lt;/em&gt; to the bot chat.&lt;/li&gt;
&lt;li&gt;The bot returns an Adaptive Card containing a simple form.&lt;/li&gt;
&lt;li&gt;The employee submits the form. &lt;/li&gt;
&lt;li&gt;The bot captures the form data and replaces the form with a confirmation message.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_H1f3CP8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5somg2qiv7fmff6dm2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_H1f3CP8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5somg2qiv7fmff6dm2w.png" alt="Contoso Restaurant sample project" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="prereqs"&gt;🏁 Prerequisites&lt;/h2&gt;

&lt;p&gt;To follow this guide successfully you will need.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Microsoft 365 Tenant&lt;/strong&gt;, which has been &lt;a href="https://learn.microsoft.com/microsoftteams/platform/m365-apps/prerequisites#prepare-a-developer-tenant-for-testing?WT.mc_id=m365-81147-garrytrinder"&gt;enabled for developing custom applications with&lt;/a&gt;. If you do not have a tenant, I highly recommend that you use a Microsoft 365 Developer Tenant, which you can obtain for free by &lt;a href="https://developer.microsoft.com/microsoft-365/dev-program?WT.mc_id=m365-81147-garrytrinder"&gt;joining the Microsoft 365 Developer Program&lt;/a&gt;. It is pre-configured for Microsoft Teams app development right out of the box.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual Studio Code&lt;/strong&gt;, if you do not have it installed, &lt;a href="https://code.visualstudio.microsoft.com"&gt;download it for free&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the prerequisites done, let’s begin!&lt;/p&gt;

&lt;h2 id="install"&gt;🛠 Install Teams Toolkit for Visual Studio Code&lt;/h2&gt;

&lt;p&gt;Our first step is to install Teams Toolkit into Visual Studio Code, you can do this several ways, however the easiest is way is to search for and install the extension using the Extensions panel from the Side Bar within Visual Studio Code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;em&gt;Visual Studio Code&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Open the &lt;em&gt;Extensions panel&lt;/em&gt; from the Side Bar.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Search for Teams Toolkit&lt;/em&gt; in the marketplace.&lt;/li&gt;
&lt;li&gt;Select &lt;em&gt;Teams Toolkit&lt;/em&gt; in the search results.&lt;/li&gt;
&lt;li&gt;Click the &lt;em&gt;Install button&lt;/em&gt; to install the extension.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the extension has been successfully installed, you will see a Microsoft Teams icon in the Side Bar.&lt;/p&gt;

&lt;h2 id="scaffold"&gt;👷 Scaffold and run the project&lt;/h2&gt;

&lt;p&gt;After installing the extension, let’s create our project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Teams Toolkit extension by clicking on the &lt;em&gt;Microsoft Teams icon&lt;/em&gt; in the Side Bar&lt;/li&gt;
&lt;li&gt;Click the &lt;em&gt;Create a new Teams app&lt;/em&gt; button to start the project scaffolding wizard&lt;/li&gt;
&lt;li&gt;Select &lt;em&gt;Create a new Teams app&lt;/em&gt; in the first step&lt;/li&gt;
&lt;li&gt;Select &lt;em&gt;Initiate sequential workflows&lt;/em&gt; in the Capabilities step&lt;/li&gt;
&lt;li&gt;Select &lt;em&gt;TypeScript&lt;/em&gt; in the Programming Language step&lt;/li&gt;
&lt;li&gt;Select a folder of your choice in the Workspace folder step, this is the location of where the project will be created.&lt;/li&gt;
&lt;li&gt;Enter &lt;em&gt;ContosoRestaurant&lt;/em&gt; in the application name step. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you complete the last step, Teams Toolkit will create a project in a folder with the same name in the Workspace folder location you selected in the previous step.&lt;/p&gt;

&lt;p&gt;After the project scaffolding is complete, Teams Toolkit will re-open Visual Studio Code in the project folder and open a Readme file for the project.&lt;/p&gt;

&lt;p&gt;The scaffolded project contains some boilerplate code which provides some basic workflow functionality, containing a command and action.&lt;/p&gt;

&lt;p&gt;You can run the bot to see how it works by opening the debug side panel, select your browser of choice in the dropdown, and start debugging by either clicking the green play icon or by pressing F5 on your keyboard.&lt;/p&gt;

&lt;p&gt;If this is the first time you have used Teams Toolkit for Visual Studio Code, when you first launch your app using Debug, you will be prompted to sign into your Microsoft 365 tenant.&lt;/p&gt;

&lt;p&gt;Click the &lt;em&gt;Sign In&lt;/em&gt; button in the prompt, this will open your primary browser and navigate you to a Microsoft 365 login screen. Enter your account details to complete the authentication flow, once successful you can close the browser window and return to Visual Studio Code.&lt;/p&gt;

&lt;p&gt;Teams Toolkit will setup all the required resources and services for your bot to run locally inside Microsoft Teams, and also provide debugging and hot reload functionality.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The first time you run your app, Teams Toolkit will perform an &lt;em&gt;npm install&lt;/em&gt; to install all the required packages, so it might take a few moments depending on your network and machine resources.&lt;/p&gt;

&lt;p&gt;This would be a good time to grab a ☕️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When complete, a browser window will be launched and you will be navigated to the web version of Microsoft Teams. You may be prompted for authentication again, if you are, just complete the steps using the same account as you signed in previously.&lt;/p&gt;

&lt;p&gt;When Microsoft Teams loads, a dialog box will appear which enables you to side load your app. Click the Add button to add the app as a personal app, and open the bot chat. &lt;/p&gt;

&lt;p&gt;Type &lt;code&gt;helloWorld&lt;/code&gt; into the chat box and send your message, this will invoke the bot command which returns an Adaptive Card with a button. &lt;/p&gt;

&lt;p&gt;Selecting the button will update the Adaptive Card with confirmation of that action.&lt;/p&gt;

&lt;h2 id="clean"&gt;👷 Clean the project&lt;/h2&gt;

&lt;p&gt;This is entirely optional, but to help follow along with the rest of this tutorial, I recommend that you remove the default code, so it doesn't get in the way and we can start from a clean slate.&lt;/p&gt;

&lt;p&gt;Don't worry about what we are removing for now, I'll explain all this as we go through the steps.&lt;/p&gt;

&lt;p&gt;If your debug session is still running, just close down the browser window or stop the debugging session in Visual Studio Code.&lt;/p&gt;

&lt;p&gt;To remove the default code, you can &lt;a href="https://gist.github.com/garrytrinder/1911550e3511ec2c0cfe551fd2c120af"&gt;use a script&lt;/a&gt; or do it manually.&lt;/p&gt;

&lt;p&gt;To manually remove the code&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete all files in the following folders 

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;bot\src\AdaptiveCards&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bot\src\cardActions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bot\src\commands&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Clear contents of &lt;code&gt;bot\src\cardModels.ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Update &lt;code&gt;/bot/src/internal/initialize.ts&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Clear &lt;code&gt;commands&lt;/code&gt; array 👉 &lt;code&gt;commands: []&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clear &lt;code&gt;actions&lt;/code&gt; array 👉 &lt;code&gt;actions: []&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remove the unused &lt;code&gt;imports&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Update &lt;code&gt;templates/appPackage/manifest.template.json&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Clear the &lt;code&gt;commands&lt;/code&gt; array 👉 &lt;code&gt;commands: []&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To use the script to remove the code&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;scripts&lt;/code&gt; folder in the root&lt;/li&gt;
&lt;li&gt;Download the file and add it to the &lt;code&gt;scripts&lt;/code&gt; folder&lt;/li&gt;
&lt;li&gt;Open terminal prompt, change to root directory&lt;/li&gt;
&lt;li&gt;Execute &lt;code&gt;node scripts\ttk_workflowbot_clean.js&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we have a clean project, let's start building out our scenario.&lt;/p&gt;

&lt;h2 id="#adaptive-cards"&gt;🧑‍💻 Create the Adaptive Card templates&lt;/h2&gt;

&lt;p&gt;The first thing we will do is implement Adaptive Cards templates, these cards represent our user interface that employees will interact with.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://learn.microsoft.com/adaptive-cards/"&gt;Adaptive Cards&lt;/a&gt; are an open card exchange format enabling developers to exchange UI content in a common and consistent way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/adaptive-cards/templating/"&gt;Templating&lt;/a&gt; enables the separation of data from the layout in an Adaptive Card, by using data binding syntax &lt;code&gt;${data}&lt;/code&gt; we can add placeholders into our templates that can be populated data when we use the Adaptive Card SDK to render the card.&lt;/p&gt;

&lt;p&gt;The first template will be sent back to the employee when they request to make an order with menu options.&lt;/p&gt;

&lt;p&gt;Let's create a new file in the &lt;code&gt;bot\src\AdaptiveCards&lt;/code&gt; folder called &lt;code&gt;orderCommandResponse.json&lt;/code&gt; with the following contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AdaptiveCard"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://adaptivecards.io/schemas/adaptive-card.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${FormInfo.title}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Large"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"weight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bolder"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Input.ChoiceSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"EntreeSelectVal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"label"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${Order.questions[0].question}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"filtered"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"isRequired"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"errorMessage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is a required input"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"placeholder"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Please choose"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"choices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"$data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${Order.questions[0].items}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${choice}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${value}"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Input.ChoiceSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SideVal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"label"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${Order.questions[1].question}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"filtered"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"isRequired"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"errorMessage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is a required input"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"placeholder"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Please choose"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"choices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"$data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${Order.questions[1].items}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${choice}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${value}"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Input.ChoiceSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DrinkVal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"label"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${Order.questions[2].question}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"filtered"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"isRequired"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"errorMessage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"This is a required input"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"placeholder"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Please choose"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"choices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"$data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${Order.questions[2].items}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${choice}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${value}"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"actions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Action.Execute"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"verb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Place Order"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When this card is rendered, it will display a mini form with three drop downs and an action button. When the action button is selected, the form data is sent to the bot along with a verb, which represents the action that was performed. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that the drop downs are given ID property values, when the form is submitted the data sent to bot as key/value pairs, e.g &lt;code&gt;{ "DrinkVal": "value" }&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4KBtnQ4_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k27a1jkdwl57k6cgkp04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4KBtnQ4_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k27a1jkdwl57k6cgkp04.png" alt="Order command response" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second template will be displayed to the employee when they have submitted their order to the restaurant.&lt;/p&gt;

&lt;p&gt;Let's create a new file in the &lt;code&gt;bot\src\AdaptiveCards&lt;/code&gt; folder called &lt;code&gt;orderActionResponse.json&lt;/code&gt; with the following contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AdaptiveCard"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://adaptivecards.io/schemas/adaptive-card.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${title}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"heading"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Container"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"FactSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"facts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Entree"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${actionData.EntreeSelectVal}"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Side"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${actionData.SideVal}"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Drink"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${actionData.DrinkVal}"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"actions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Action.Execute"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Edit Order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"verb"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"order-edit"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When this card is rendered, it will display the selected options submitted in the first card and an action button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T623pv8Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s6v4vmd8cck3p4iohll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T623pv8Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s6v4vmd8cck3p4iohll.png" alt="Order action response" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our templates in place, let's create the data models to define the correct data shape to use with our template when we render the card using the Adaptive Cards SDK.&lt;/p&gt;

&lt;p&gt;Open the &lt;code&gt;bot/src/cardModels.ts&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Add the following interfaces which describes the data shape for the &lt;code&gt;bot\src\AdaptiveCards\orderCommandResponse.json&lt;/code&gt; card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;OrderData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;FormInfo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FormInfo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;FormInfo&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Order&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;questions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Question&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Question&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;question&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Item&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following interfaces which describes the data shape for the &lt;code&gt;bot\src\AdaptiveCards\orderCommandResponse.json&lt;/code&gt; card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;OrderResponseData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;actionData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;OrderActionData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;OrderActionData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;EntreeSelectVal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;SideVal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;DrinkVal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;OrderActionData&lt;/code&gt; interface also provides the shape of the data which is returned to our bot when the first card is submitted.&lt;/p&gt;

&lt;p&gt;Take a moment to look at the data binding syntax used in the templates and the shape of the data defined in the data models.&lt;/p&gt;

&lt;h2 id="command"&gt;📝 Create the order command&lt;/h2&gt;

&lt;p&gt;To create a new command we need to perform three tasks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create the command handler&lt;/li&gt;
&lt;li&gt;Update the bot configuration&lt;/li&gt;
&lt;li&gt;Update the app manifest&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create the command handler
&lt;/h3&gt;

&lt;p&gt;With our user interface defined, let's create the &lt;code&gt;order&lt;/code&gt; command which our employees will use to start the order process.&lt;/p&gt;

&lt;p&gt;Let's create a new file in the &lt;code&gt;bot\src\commands&lt;/code&gt; folder called &lt;code&gt;orderCommandHandler.ts&lt;/code&gt; with the following contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;OrderCommandHandler&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxBotCommandHandler&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;OrderCommandHandler&lt;/code&gt; class will represent the handler for when the &lt;code&gt;order&lt;/code&gt; command is sent in the bot chat. &lt;/p&gt;

&lt;p&gt;We will use the &lt;code&gt;TeamsFxBotCommandHandler&lt;/code&gt; interface from the &lt;code&gt;@microsoft/teamsfx&lt;/code&gt; library to implement the handler functionality.&lt;/p&gt;

&lt;p&gt;Let's import the &lt;code&gt;CommandMessage&lt;/code&gt;, &lt;code&gt;TeamsFxBotCommandHandler&lt;/code&gt; and &lt;code&gt;TriggerPatterns&lt;/code&gt; classes from the &lt;code&gt;@microsoft/teamsfx&lt;/code&gt; library, the TurnContext class and Activity interface from &lt;code&gt;botbuilder&lt;/code&gt; library, and implement the &lt;code&gt;TeamsFxBotCommandHandler&lt;/code&gt; interface.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can use the &lt;a href="https://code.visualstudio.com/docs/editor/refactoring#_code-actions-quick-fixes-and-refactorings"&gt;Quick Fix&lt;/a&gt; menu in Visual Studio Code to import packages and implement interfaces quickly&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CommandMessage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxBotCommandHandler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TriggerPatterns&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@microsoft/teamsfx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Activity&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;botbuilder&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;OrderCommandHandler&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxBotCommandHandler&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nl"&gt;triggerPatterns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TriggerPatterns&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;handleCommandReceived&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;CommandMessage&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nb"&gt;Partial&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Activity&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Method not implemented.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's update the &lt;code&gt;triggerPatterns&lt;/code&gt; property with the value &lt;code&gt;order&lt;/code&gt;. This property defines the keyword that the bot will listen out for when it is sent messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;triggerPatterns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TriggerPatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;order&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let's add the logic to the &lt;code&gt;handleCommandReceived&lt;/code&gt; method that will be executed when the handler is invoked.&lt;/p&gt;

&lt;p&gt;First, add the &lt;code&gt;async&lt;/code&gt; keyword to the method declaration as the method will return a &lt;code&gt;Promise&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;handleCommandReceived&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;CommandMessage&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nb"&gt;Partial&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Activity&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we will create a new object that we will use populate the template in the shape of the &lt;code&gt;OrderData&lt;/code&gt; model that we defined earlier. This object will represent the menu options that the employee can choose from in the form.&lt;/p&gt;

&lt;p&gt;Import the &lt;code&gt;OrderData&lt;/code&gt; interface using an import statement at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrderData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../cardModels&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new constant called &lt;code&gt;orderData&lt;/code&gt; using the &lt;code&gt;OrderData&lt;/code&gt; interface as its type, replacing the &lt;code&gt;throw&lt;/code&gt; statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orderData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;OrderData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;FormInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Malt &amp;amp; Vine Order Form&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Order&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;questions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;question&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Which entree would you like?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;items&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Steak&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Steak&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Chicken&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Chicken&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tofu&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tofu&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;question&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Which side would you like?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;items&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Baked Potato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Baked Potato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Rice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Baked Potato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Vegetables&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Baked Potato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Noodles&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Baked Potato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No Side&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Baked Potato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;question&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Which drink would you like?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;items&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Water&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Water&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Soft Drink&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Soft Drink&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Coffee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Coffee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Natural Juice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Natural Juice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;choice&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No Drink&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No Drink&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have our data, we need to populate our template with &lt;code&gt;orderData&lt;/code&gt; to render a card that we can then send to the bot chat as our response. To do this we need to import our template and the Adaptive Cards SDK.&lt;/p&gt;

&lt;p&gt;Import the template and SDK by adding import statements at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;orderCard&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../adaptiveCards/orderCommandResponse.json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCards&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@microsoft/adaptivecards-tools&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following line after you initialise the &lt;code&gt;orderData&lt;/code&gt; constant, where we will use the Adaptive Cards SDK to parse the template and passing the data object to it to render the card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cardJson&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCards&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kr"&gt;declare&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;OrderData&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orderCard&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orderData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We now have a card populated with data and ready to be sent, so let's do that.&lt;/p&gt;

&lt;p&gt;Import the &lt;code&gt;MessageFactory&lt;/code&gt; and &lt;code&gt;CardFactory&lt;/code&gt; classes from the &lt;code&gt;botbuilder&lt;/code&gt; library by updating the existing import statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Activity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MessageFactory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;CardFactory&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;botbuilder&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following line after you initialise the &lt;code&gt;cardJson&lt;/code&gt; constant to send the populated Adaptive Card to the bot chat.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;MessageFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attachment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;CardFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;adaptiveCard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cardJson&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Update the bot configuration
&lt;/h3&gt;

&lt;p&gt;After implementing the command handler, the next step is to update the bot configuration to tell our bot about our new handler.&lt;/p&gt;

&lt;p&gt;Open the &lt;code&gt;bot\src\internal\initialize.ts&lt;/code&gt; file which contains our bot configuration and import the &lt;code&gt;OrderCommandHandler&lt;/code&gt; class at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrderCommandHandler&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../commands/orderCommandHandler&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update the &lt;code&gt;commands&lt;/code&gt; array, including a new instance of the &lt;code&gt;OrderCommandHandler&lt;/code&gt; class in the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;commands&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;OrderCommandHandler&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Update the app manifest
&lt;/h3&gt;

&lt;p&gt;The final step is to add our order command to the list of suggestions that the bot can recommend to employees who use it.&lt;/p&gt;

&lt;p&gt;Open the &lt;code&gt;templates\manifest.template.json&lt;/code&gt; app manifest file, which describes how our app integrates into Microsoft Teams.&lt;/p&gt;

&lt;p&gt;Update the &lt;code&gt;commands&lt;/code&gt; array, including a new command object in the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"commands"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"order"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Place an order"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hCCtPYCg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig2lp6x0q1338ys02dvp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hCCtPYCg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig2lp6x0q1338ys02dvp.png" alt="Bot Suggestions" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="order-action"&gt;⚡️ Create the order card action&lt;/h2&gt;

&lt;p&gt;With our user interface and command handler defined, we now need to create an action handler which will be triggered when the employee submits the order.&lt;/p&gt;

&lt;p&gt;To create a new action handler we need to perform two tasks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create the action handler&lt;/li&gt;
&lt;li&gt;Update the bot configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create the action handler
&lt;/h3&gt;

&lt;p&gt;Let's create a new file in the &lt;code&gt;bot\src\cardActions&lt;/code&gt; folder called &lt;code&gt;orderActionHandler.ts&lt;/code&gt; with the following contents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;OrderActionHandler&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxAdaptiveCardActionHandler&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;OrderActionHandler&lt;/code&gt; class will represent the handler for when an Adaptive Card action that uses the &lt;code&gt;Action.Execute&lt;/code&gt; type passing the &lt;code&gt;order&lt;/code&gt; verb. &lt;/p&gt;

&lt;p&gt;We will use the &lt;code&gt;TeamsFxAdaptiveCardActionHandler&lt;/code&gt; interface from the &lt;code&gt;@microsoft/teamsfx&lt;/code&gt; library to implement the handler functionality.&lt;/p&gt;

&lt;p&gt;Let's import the &lt;code&gt;AdaptiveCardResponse&lt;/code&gt; enum and &lt;code&gt;TeamsFxAdaptiveCardActionHandler&lt;/code&gt; class from the &lt;code&gt;@microsoft/teamsfx&lt;/code&gt; library, the &lt;code&gt;TurnContext&lt;/code&gt; class and &lt;code&gt;InvokeResponse&lt;/code&gt; interface from &lt;code&gt;botbuilder&lt;/code&gt; library, and implement the &lt;code&gt;TeamsFxAdaptiveCardActionHandler&lt;/code&gt; interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCardResponse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxAdaptiveCardActionHandler&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@microsoft/teamsfx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;InvokeResponse&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;botbuilder&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;OrderActionHandler&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxAdaptiveCardActionHandler&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nl"&gt;triggerVerb&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nl"&gt;adaptiveCardResponse&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCardResponse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nx"&gt;handleActionInvoked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;actionData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;InvokeResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Method not implemented.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's update the &lt;code&gt;triggerVerb&lt;/code&gt; property with the value &lt;code&gt;order&lt;/code&gt;. This property defines the verb that the bot will listen out for when it is sent data as a result of an &lt;code&gt;Action.Execute&lt;/code&gt; action invoked from an Adaptive Card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;triggerVerb&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;order&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let's add the logic to the &lt;code&gt;handleActionInvoked&lt;/code&gt; method that will be executed when the handler is invoked.&lt;/p&gt;

&lt;p&gt;Add the &lt;code&gt;async&lt;/code&gt; keyword to the method declaration as the method will return a &lt;code&gt;Promise&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;handleActionInvoked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;actionData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;InvokeResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may have noticed that &lt;code&gt;handleActionInvoked&lt;/code&gt; method returns an &lt;code&gt;actionData&lt;/code&gt; parameter, this will contain the data submitted from our Adaptive Card. &lt;/p&gt;

&lt;p&gt;As we have already defined the model for this data, let's replace &lt;code&gt;any&lt;/code&gt; with our own type.&lt;/p&gt;

&lt;p&gt;Import the &lt;code&gt;OrderActionData&lt;/code&gt; interface using an import statement at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrderActionData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../cardModels&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update &lt;code&gt;actionData&lt;/code&gt; parameter type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;handleActionInvoked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TurnContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;actionData&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;OrderActionData&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;InvokeResponse&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we will create a new object that we will use populate the template in the shape of the &lt;code&gt;OrderResponseData&lt;/code&gt; model that we defined earlier. This object will represent the menu options selected by the employee and includes a title to display in the confirmation.&lt;/p&gt;

&lt;p&gt;Import the &lt;code&gt;OrderResponseData&lt;/code&gt; interface using an import statement at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrderResponseData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../cardModels&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new constant called &lt;code&gt;orderResponseData&lt;/code&gt; using the &lt;code&gt;OrderResponseData&lt;/code&gt; interface as its type, replacing the &lt;code&gt;throw&lt;/code&gt; statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;orderResponseData:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;OrderResponseData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;title:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"✅ [ACK] Order Placed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;actionData&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have our data, we need to populate our template with &lt;code&gt;orderResponseData&lt;/code&gt; to render a card that we can then replace the submitted Adaptive Card with. To do this we need to import our template and the Adaptive Cards SDK.&lt;/p&gt;

&lt;p&gt;Import the template and SDK by adding import statements at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;orderActionResponseCard&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../adaptiveCards/orderActionResponse.json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCards&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@microsoft/adaptivecards-tools&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following line after you initialise the &lt;code&gt;orderResponseData&lt;/code&gt; constant, where we will use the Adaptive Cards SDK to parse the template and passing the data object to it to render the card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cardJson&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCards&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kr"&gt;declare&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;OrderResponseData&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orderActionResponseCard&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orderResponseData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We now have a card populated with data and ready to be sent, so let's do that.&lt;/p&gt;

&lt;p&gt;Import the &lt;code&gt;InvokeResponseFactory&lt;/code&gt; class from the &lt;code&gt;@microsoft/teamsfx&lt;/code&gt; library by updating the existing import statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AdaptiveCardResponse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;InvokeResponseFactory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TeamsFxAdaptiveCardActionHandler&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@microsoft/teamsfx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following line after you initialise the &lt;code&gt;cardJson&lt;/code&gt; constant to send the populated Adaptive Card to the bot chat, replacing the existing Adaptive Card.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;InvokeResponseFactory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;adaptiveCard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cardJson&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Update the bot configuration
&lt;/h3&gt;

&lt;p&gt;After implementing the action handler, the next step is to update the bot configuration to tell our bot about our new handler.&lt;/p&gt;

&lt;p&gt;Open the &lt;code&gt;bot\src\internal\initialize.ts&lt;/code&gt; file which contains our bot configuration and import the &lt;code&gt;OrderActionHandler&lt;/code&gt; class at the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrderCommandHandler&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../commands/orderCommandHandler&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update the &lt;code&gt;actions&lt;/code&gt; array, including a new instance of the &lt;code&gt;OrderActionHandler&lt;/code&gt; class in the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;cardAction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;OrderActionHandler&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2 id="place-order"&gt;🙋 Place your order&lt;/h2&gt;

&lt;p&gt;Now it's time to run our bot and test it out.&lt;/p&gt;

&lt;p&gt;You can do this easily, either by opening the Debug panel and selecting the green play button or by pressing F5 on your keyboard. &lt;/p&gt;

&lt;p&gt;Follow the steps to side load your application, when the bot chat is visible, submit &lt;code&gt;order&lt;/code&gt; in the chat to start the workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--45wyxYrj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84c8ot8ako6hvmdv1ywk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--45wyxYrj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84c8ot8ako6hvmdv1ywk.png" alt="Order placed" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🎉 Congratulations! You've just created your first bot that implements a simple workflow to automate a repetitive task enabling an employee to place an order with the company restaurant.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id="what-next"&gt;⏭ What next?&lt;/h2&gt;

&lt;p&gt;Want to make more updates? Here are a few things you can try.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Edit order&lt;/strong&gt;, implement the &lt;em&gt;Edit Order&lt;/em&gt; button that is displayed when the order is confirmed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expand the menu&lt;/strong&gt;, add more options to the order form.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update the app icons&lt;/strong&gt;, currently the app uses stock icons, update the icons in the &lt;code&gt;templates/appPackage/resources&lt;/code&gt; directory with new, more relevant icons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restrict supported Teams scopes&lt;/strong&gt;, by default the bot can be installed into a personal, chat or channel context, to restrict where the bot can be used, update the scopes array in the app manifest.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="learn-more"&gt;📚 Learn more&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.microsoft.com/microsoft-teams?WT.mc_id=m365-79415-garrytrinder"&gt;Microsoft Teams Developer Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/microsoftteams/platform/overview?WT.mc_id=m365-79415-garrytrinder"&gt;Teams Toolkit Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/microsoftteams/platform/toolkit/teams-toolkit-fundamentals?WT.mc_id=m365-79415-garrytrinder"&gt;Teams Toolkit Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/workflow-bot-in-teams?tabs=JS&amp;amp;WT.mc_id=m365-79415-garrytrinder"&gt;Workflow bot in Teams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/microsoftteams/platform/sbs-gs-workflow-bot?tabs=vscode?WT.mc_id=m365-79415-garrytrinder"&gt;Build workflow bot&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;👋 Happy coding!&lt;/p&gt;

&lt;p&gt;Banner image generated using DALL·E 2 text to image API, &lt;em&gt;a robot placing an order at a restaurant&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>microsoft365dev</category>
      <category>microsoftteams</category>
      <category>bots</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Build a stock update notification bot for Microsoft Teams using C# and Teams Toolkit for Visual Studio</title>
      <dc:creator>Garry Trinder</dc:creator>
      <pubDate>Tue, 08 Nov 2022 13:31:00 +0000</pubDate>
      <link>https://dev.to/microsoft365/build-a-stock-update-notification-bot-for-microsoft-teams-using-c-and-teams-toolkit-for-visual-studio-mfl</link>
      <guid>https://dev.to/microsoft365/build-a-stock-update-notification-bot-for-microsoft-teams-using-c-and-teams-toolkit-for-visual-studio-mfl</guid>
      <description>&lt;p&gt;Microsoft Teams Toolkit for Visual Studio enables you to create, debug and deploy Microsoft Teams apps to a Microsoft 365 tenant fast using a no configuration approach.&lt;/p&gt;

&lt;p&gt;In this tutorial, I will guide you through the steps to create a Stock Update Notification bot for Teams Toolkit and C#.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fousl8nhmo2wsjti675ho.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fousl8nhmo2wsjti675ho.gif" alt="Animated GIF showing Microsoft Teams receiving a notification from a bot, the user opening the bot to find the latest stock price for Microsoft Corporation rendered as an Adaptive Card"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to see the finished version, checkout the &lt;a href="https://github.com/OfficeDev/TeamsFx-Samples/tree/dev/stocks-update-notification-bot-dotnet" rel="noopener noreferrer"&gt;sample code&lt;/a&gt; in the TeamsFX Samples GitHub repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Install Teams Toolkit for Visual Studio&lt;/li&gt;
&lt;li&gt;Scaffold the project&lt;/li&gt;
&lt;li&gt;Update the adaptive card&lt;/li&gt;
&lt;li&gt;Update the bot logic&lt;/li&gt;
&lt;li&gt;Start ngrok&lt;/li&gt;
&lt;li&gt;Prepare dependencies&lt;/li&gt;
&lt;li&gt;Test your bot&lt;/li&gt;
&lt;li&gt;What next?&lt;/li&gt;
&lt;li&gt;Learn more!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="prereqs"&gt;🏁 Prerequisites&lt;/h2&gt;

&lt;p&gt;To follow this guide successfully you will need.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Microsoft 365 Tenant&lt;/strong&gt;, which has been &lt;a href="https://learn.microsoft.com/microsoftteams/platform/m365-apps/prerequisites#prepare-a-developer-tenant-for-testing?WT.mc_id=m365-81147-garrytrinder" rel="noopener noreferrer"&gt;enabled for developing custom applications with&lt;/a&gt;. If you do not have a tenant, I highly recommend that you use a Microsoft 365 Developer Tenant, which you can obtain for free by &lt;a href="https://developer.microsoft.com/microsoft-365/dev-program?WT.mc_id=m365-81147-garrytrinder" rel="noopener noreferrer"&gt;joining the Microsoft 365 Developer Program&lt;/a&gt;. It is pre-configured for Microsoft Teams app development right out of the box.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Visual Studio 2022 17.3+&lt;/strong&gt;, you can use either of the Community, Professional or Enterprise editions. If you do not have Visual Studio installed, &lt;a href="https://visualstudio.microsoft.com/vs/community/" rel="noopener noreferrer"&gt;try out the Community edition for free&lt;/a&gt;!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ngrok&lt;/strong&gt;, is a globally distributed reverse proxy which you can use to promote web services running on your local machine to an internet available address, in short, it puts localhost on the internet. This is required for Microsoft Teams to talk to the code running locally on your machine. If you do not have ngrok you can &lt;a href="https://ngrok.com/" rel="noopener noreferrer"&gt;download for free&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the prerequisites done, let’s begin!&lt;/p&gt;

&lt;h2 id="install"&gt;🛠 Install Teams Toolkit for Visual Studio&lt;/h2&gt;

&lt;p&gt;Our first step is to install Teams Toolkit into Visual Studio.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;em&gt;Visual Studio Installer&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;em&gt;Modify&lt;/em&gt; button to configure your installation.&lt;/li&gt;
&lt;li&gt;On the &lt;em&gt;Workloads&lt;/em&gt; tab, select the &lt;em&gt;ASP.NET and web development&lt;/em&gt; workload.&lt;/li&gt;
&lt;li&gt;In the &lt;em&gt;Installation details&lt;/em&gt; pane on the right, scroll down the list and check the option called &lt;em&gt;Microsoft Teams development tools&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;em&gt;Modify&lt;/em&gt; button to install Teams Toolkit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the installation is complete, you can close the Visual Studio installer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s7wabbgg16lllz5psc0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s7wabbgg16lllz5psc0.png" alt="Screenshot of Visual Studio Installer showing the ASP.NET and web development workload and Microsoft Teams development tools checked"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="scaffold"&gt;👷 Scaffold the project&lt;/h2&gt;

&lt;p&gt;After installing Teams Toolkit into Visual Studio, it is now time to create our project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;em&gt;Visual Studio 2022&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;From the start-up screen, select &lt;em&gt;Create a new project&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;On the &lt;em&gt;Create a new project screen&lt;/em&gt;, expand the &lt;em&gt;All platforms&lt;/em&gt; dropdown, and select &lt;em&gt;Microsoft Teams&lt;/em&gt;, this will display a single template called &lt;em&gt;Microsoft Teams App&lt;/em&gt;, click &lt;em&gt;Next&lt;/em&gt; to confirm the template choice.&lt;/li&gt;
&lt;li&gt;On the Configure your new project screen, enter &lt;em&gt;StocksUpdateNotificationBot&lt;/em&gt; in the Project name field, then click &lt;em&gt;Create&lt;/em&gt; to confirm.&lt;/li&gt;
&lt;li&gt;In the &lt;em&gt;Create a new Teams application dialog&lt;/em&gt;, expand the &lt;em&gt;Trigger type&lt;/em&gt; dropdown, and select &lt;em&gt;Timer Trigger (Azure Function)&lt;/em&gt;, then click &lt;em&gt;Create&lt;/em&gt; to confirm.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Teams Toolkit will now generate a new project for you and open it for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbp6nez3zduin1e2lr1b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbp6nez3zduin1e2lr1b.png" alt="Screenshot of the Create a new Teams application dialog, with Notification Bot selected and the Trigger Type dropdown expanded"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="adaptive-card"&gt;ℹ️ Update the adaptive card&lt;/h2&gt;

&lt;p&gt;We will use an Adaptive Card to represent our stock price update, so let’s update the default adaptive card design to fit our needs.&lt;/p&gt;

&lt;p&gt;Open the &lt;em&gt;NotificationDefault.json&lt;/em&gt; file in the Resources directory and replace the contents with the following JSON.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://adaptivecards.io/schemas/adaptive-card.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AdaptiveCard"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Container"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${name}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Medium"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${symbol}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"isSubtle"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"spacing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"None"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{DATE(${timestamp},SHORT)}} {{TIME(${timestamp})}}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Container"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"spacing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"None"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ColumnSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"columns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Column"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"stretch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${formatNumber(price,2)}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ExtraLarge"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"TextBlock"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${if(change &amp;gt;= 0, '▲', '▼')} ${formatNumber(change,2)} USD (${formatNumber(changePercent, 2)}%)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"spacing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"None"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"wrap"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Column"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"FactSet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="nl"&gt;"facts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                      &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Open"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                      &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${formatNumber(open,2)}"&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                      &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"High"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                      &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${formatNumber(high,2)}"&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                      &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Low"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                      &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${formatNumber(low,2)}"&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
                  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
              &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are using Adaptive Cards Template Language here to provide separation between our data and layout. Using binding expressions i.e., &lt;em&gt;${name}&lt;/em&gt;, we can add placeholders to our layout in locations where we want our data to be rendered.&lt;/p&gt;

&lt;p&gt;Let’s create a class to represent the data object to use with the template. Open the &lt;em&gt;NotificationDefaultModel.ts&lt;/em&gt; file in the Models directory and replace the contents with the following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;StocksUpdateNotificationBot.Models&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GlobalQuote&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Symbol&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;Open&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;High&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;Low&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;Volume&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;LatestTradingDay&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;PreviousClose&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;Change&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;ChangePercent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Timestamp&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we combine our template and data using the Adaptive Cards SDK, the notification will look something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5tqvgpctbr2gh26vn4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5tqvgpctbr2gh26vn4f.png" alt="A rendered Adaptive Card showing stock price information for MSFT"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="bot-logic"&gt;🤖 Update the bot logic&lt;/h2&gt;

&lt;p&gt;Open the &lt;em&gt;NotifyTimerTrigger.cs&lt;/em&gt; file, this file contains the core logic of our bot that will be executed on a schedule. &lt;/p&gt;

&lt;p&gt;For now, let’s remove the contents of Run method and remove unused using statements, you can remove the statements by using the keyboard shortcut, &lt;em&gt;Ctrl + R followed by Ctrl + G&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;As our bot will call out to an external API, we will need an HTTP client to execute the requests, so let’s also create a new read-only property in the &lt;em&gt;NotifyTimerTrigger&lt;/em&gt; class and create a new HTTP client.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;HttpClient&lt;/span&gt; &lt;span class="n"&gt;_client&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your file should look like the below block of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Azure.WebJobs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Extensions.Logging&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.TeamsFx.Conversation&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;ExecutionContext&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Azure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WebJobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ExecutionContext&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;StocksUpdateNotificationBot&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;sealed&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NotifyTimerTrigger&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;ConversationBot&lt;/span&gt; &lt;span class="n"&gt;_conversation&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;NotifyTimerTrigger&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;HttpClient&lt;/span&gt; &lt;span class="n"&gt;_client&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;NotifyTimerTrigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ConversationBot&lt;/span&gt; &lt;span class="n"&gt;conversation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;NotifyTimerTrigger&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_conversation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conversation&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;_log&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;FunctionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"NotifyTimerTrigger"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nf"&gt;TimerTrigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"*/30 * * * * *"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="n"&gt;TimerInfo&lt;/span&gt; &lt;span class="n"&gt;myTimer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ExecutionContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CancellationToken&lt;/span&gt; &lt;span class="n"&gt;cancellationToken&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s add in the logic for our bot.&lt;/p&gt;

&lt;p&gt;First let’s add a &lt;em&gt;try/catch&lt;/em&gt; block to the &lt;em&gt;Run&lt;/em&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// bot logic goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HttpRequestException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the bot is executed, our bot will need to obtain the latest stock price, to do this we will send a HTTP request to the Alpha Vantage API.&lt;/p&gt;

&lt;p&gt;Replace the &lt;em&gt;// bot logic goes here&lt;/em&gt; comment inside the &lt;em&gt;try&lt;/em&gt; block, with the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Get quote data from Alpha Vantage API&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetStringAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"https://www.alphavantage.co/query?function=GLOBAL_QUOTE&amp;amp;symbol=MSFT&amp;amp;apikey=demo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cancellationToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we need to deserialize and transform the response into the correct shape to use with our Adaptive Card model.&lt;/p&gt;

&lt;p&gt;Add the following using statements to the top of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Newtonsoft.Json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Newtonsoft.Json.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;StocksUpdateNotificationBot.Models&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following code into the &lt;em&gt;try&lt;/em&gt; block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Deserialize JSON response&lt;/span&gt;
&lt;span class="n"&gt;JObject&lt;/span&gt; &lt;span class="n"&gt;jObj&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;JObject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;JsonConvert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;DeserializeObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Transform Global Quote object&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;globalQuote&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;GlobalQuote&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Symbol&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"01. symbol"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="n"&gt;Open&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"02. open"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;High&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"03. high"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;Low&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"04. low"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"05. price"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;Volume&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"06. volume"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;LatestTradingDay&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"07. latest trading day"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="n"&gt;PreviousClose&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"08. previous close"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;Change&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"09. change"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="n"&gt;ChangePercent&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Global Quote"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"10. change percent"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Microsoft Corporation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Timestamp&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;$"&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToUniversalTime&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"o"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;Split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s"&gt;Z"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have all the data and it has been transformed into the correct shape, we need to obtain our Adaptive Card template.&lt;/p&gt;

&lt;p&gt;Add the following code into the &lt;em&gt;try&lt;/em&gt; block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Read adaptive card template&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;adaptiveCardFilePath&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Combine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FunctionAppDirectory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Resources"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"NotificationDefault.json"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cardTemplate&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadAllTextAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;adaptiveCardFilePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cancellationToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we want to iterate over all the locations where the bot has been installed in Microsoft Teams, render our Adaptive Card by combining the data and template, and send the card output into those locations.&lt;/p&gt;

&lt;p&gt;Add the following code into the &lt;em&gt;try&lt;/em&gt; block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Get bot installation&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;installations&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_conversation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Notification&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetInstallationsAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cancellationToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;installation&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;installations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Build and send adaptive card&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cardContent&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;AdaptiveCardTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cardTemplate&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;Expand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;globalQuote&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;installation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SendAdaptiveCard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;JsonConvert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;DeserializeObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cardContent&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;cancellationToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s the code complete, so let’s move onto getting our project ready to run our bot locally.&lt;/p&gt;

&lt;h2 id="ngrok"&gt;📡 Start ngrok&lt;/h2&gt;

&lt;p&gt;We need to ensure that ngrok is running so that Microsoft Teams can communicate with the code running on our local machines. &lt;/p&gt;

&lt;p&gt;Open a terminal prompt at the location where you installed the ngrok executable and start the ngrok service forwarding port 5130 using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.\ngrok http 5130
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When ngrok is running, a dashboard will be displayed in your terminal prompt with the internet accessible ngrok address that is forwarding network traffic to your localhost hostname, which will be in the format of &lt;em&gt;..ngrok.io&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ivl3wpqmawfhlnmlhnx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ivl3wpqmawfhlnmlhnx.png" alt="Screenshot of ngrok running in Windows Terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id="dependencies"&gt;🧑‍🍳 Prepare dependencies&lt;/h2&gt;

&lt;p&gt;In Visual Studio, right click the &lt;em&gt;StocksUpdateNotificationBot&lt;/em&gt; project in the Solution Explorer pane, expand the &lt;em&gt;Teams Toolkit&lt;/em&gt; menu and select the first option in the menu, &lt;em&gt;Prepare Teams Apps Dependencies&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqr66x7h8bpf4k9em53n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqr66x7h8bpf4k9em53n.png" alt="Screenshot of the steps to start the Prepare Teams Apps Dependencies process in Visual Studio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A Visual Studio account dialog box will be shown, add your Microsoft 365 Tenant account and follow the authentication steps. Once your account has been authenticated, click &lt;em&gt;Continue&lt;/em&gt; to start the process.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Prepare Teams Apps Dependencies&lt;/em&gt; process ensures that the required resources have been provisioned in your target Microsoft 365 Tenant, that services that are needed are running on your machine, such as ngrok, and updating the app manifest file.&lt;/p&gt;

&lt;h2 id="test"&gt;🧪 Test your bot&lt;/h2&gt;

&lt;p&gt;Now it is time to see our bot in action!&lt;/p&gt;

&lt;p&gt;To do this, simply press F5 on your keyboard.&lt;/p&gt;

&lt;p&gt;The first time you run your bot, you will need to allow the Azure Functions executable to send network requests through the Windows Defender firewall, to enable this, click &lt;em&gt;Allow access&lt;/em&gt; in the prompt.&lt;/p&gt;

&lt;p&gt;Teams Toolkit will open a browser window for you and start to open Microsoft Teams, you may be asked to sign into you Microsoft 365 Tenant at this point, if you are, complete the process. When you are authenticated, you will be presented with Microsoft Teams dialog which enables you to side load our app into your Microsoft 365 tenant. &lt;/p&gt;

&lt;p&gt;Click the &lt;em&gt;Add&lt;/em&gt; button to install the bot as a personal app and you will be taken to the chat tab of your personal app.&lt;/p&gt;

&lt;p&gt;Wait a few seconds for your bot to be executed, and you will see a message arrive from our bot with the latest stock price rendered as an Adaptive Card.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Congratulations, you have just created your first notification bot using Teams Toolkit for Visual Studio! 🎉&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id="next"&gt;⏭ What next?&lt;/h2&gt;

&lt;p&gt;Want to make some updates? Here are a few things you can try.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use a different symbol&lt;/strong&gt;, currently the stock price for MSFT is returned, pass a different symbol into the API call, and update the company name in the &lt;em&gt;GlobalQuote&lt;/em&gt; object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change the timer frequency&lt;/strong&gt;, currently the timer trigger is executed every 30 seconds, change this by updating the CRON expression passed into the Run method in &lt;em&gt;NotificationTimerTrigger.cs&lt;/em&gt; file. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update the app manifest&lt;/strong&gt;, currently the app manifest contains mostly default values, use the &lt;em&gt;Open Manifest File&lt;/em&gt; menu item in the Teams Toolkit menu to open the app manifest template and makes changes to it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update the app icons&lt;/strong&gt;, currently the app uses stock icons, update the icons in the &lt;em&gt;Templates/appPackage/resources&lt;/em&gt; directory with new more relevant icons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disable the bot chat compose box and @ mentions&lt;/strong&gt;, by default the bot chat compose box and the ability to @ mention the bot is enabled. To disable this, edit the app manifest and update the &lt;em&gt;isNotificationOnly&lt;/em&gt; property to &lt;em&gt;true&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restrict supported Teams scopes&lt;/strong&gt;, by default the bot can be installed into a personal, chat or channel context, to restrict where the bot can be used, update the scopes array in the app manifest.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="learn-more"&gt;📚 Learn more!&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.microsoft.com/microsoft-teams?WT.mc_id=m365-81147-garrytrinder" rel="noopener noreferrer"&gt;Microsoft Teams Developer Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/microsoftteams/platform/overview?WT.mc_id=m365-81147-garrytrinder" rel="noopener noreferrer"&gt;Teams Toolkit Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/microsoftteams/platform/toolkit/teams-toolkit-fundamentals?WT.mc_id=m365-81147-garrytrinder" rel="noopener noreferrer"&gt;Teams Toolkit Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/microsoftteams/platform/sbs-gs-csharp?WT.mc_id=m365-81147-garrytrinder" rel="noopener noreferrer"&gt;Build your first app using C#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;👋 Happy coding!&lt;/p&gt;

&lt;p&gt;Banner image generated using DALL·E 2 text to image API, &lt;em&gt;A friendly robot stood on the wall street trading floor&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>microsoft365dev</category>
      <category>visualstudio</category>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Beginners’ crash course to build apps for Teams</title>
      <dc:creator>Rabia Williams</dc:creator>
      <pubDate>Thu, 13 Oct 2022 00:51:25 +0000</pubDate>
      <link>https://dev.to/microsoft365/beginners-crash-course-to-build-apps-for-teams-36al</link>
      <guid>https://dev.to/microsoft365/beginners-crash-course-to-build-apps-for-teams-36al</guid>
      <description>&lt;p&gt;Teams Toolkit is an extension for Visual Studio Code and Visual Studio 2022, that you can use to build and deliver apps faster for Microsoft Teams. Developers can focus on building amazing applications instead of solving problems like tunnelling, identity, deployment, distribution of app and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does Teams Toolkit help a new developer?
&lt;/h2&gt;

&lt;p&gt;⚒️The toolkit comes with the Get Started page that has a checklist of everything you, as a developer, need to build an application.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get your development environment ready&lt;/li&gt;
&lt;li&gt;Create the base project&lt;/li&gt;
&lt;li&gt;Create a sandbox development environment for you (If you don’t already have one) to test your application&lt;/li&gt;
&lt;li&gt;Preview your application locally&lt;/li&gt;
&lt;li&gt;Provision Azure resource instances your app needs and deploy your application logic to host them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📽️Watch how we build a bot for Microsoft Teams using the VS Code extension.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/aCfZcYCPz4I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;📖Read step by step tutorial &lt;a href="https://devblogs.microsoft.com/microsoft365dev/beginners-crash-course-to-build-apps-for-teams-using-teams-toolkit-for-visual-studio-code/"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>vscode</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Stream IoT data into Excel</title>
      <dc:creator>Jim Bennett</dc:creator>
      <pubDate>Wed, 10 Nov 2021 17:44:46 +0000</pubDate>
      <link>https://dev.to/microsoft365/stream-iot-data-into-excel-12kc</link>
      <guid>https://dev.to/microsoft365/stream-iot-data-into-excel-12kc</guid>
      <description>&lt;p&gt;There is a whole world of IoT services out there that allow you to connect your device and upload data to the cloud. From there you can make decisions on your data, run it through AI models, or visualize it with powerful dashboards.&lt;/p&gt;

&lt;p&gt;But what if that's just too much? What if you just want to see the data in Excel?&lt;/p&gt;

&lt;p&gt;This is a common case - especially in schools that are introducing physical computing to CS students. They often don't have the money, expertise, or firewall access to spin up cloud services to ingest data, and visualization services to show it. What they do often have is Excel - either running on PCs, Macs, Chromebooks or iPads, and usually want to connect a simple device to something, and plot data from it so students can work on projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3xuzsxo4jtf5it62zpbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3xuzsxo4jtf5it62zpbc.png" alt="A soil moisture sensor in a plant pot" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One example is digital agriculture, which in schools is often a temperature sensor used to calculate &lt;a href="https://en.wikipedia.org/wiki/Growing_degree-day" rel="noopener noreferrer"&gt;growing degree days&lt;/a&gt;, or a soil moisture sensor, maybe combined with a relay and pump, to track if a plant needs water and if so automatically water it.&lt;/p&gt;

&lt;p&gt;There are many devices and kits that can provide the physical computing side – such as &lt;a href="https://www.raspberrypi.com/" rel="noopener noreferrer"&gt;Raspberry Pis&lt;/a&gt;, &lt;a href="https://arduino.cc/" rel="noopener noreferrer"&gt;Arduinos&lt;/a&gt;, and &lt;a href="https://wiki.seeedstudio.com/Grove_Base_Hat_for_Raspberry_Pi/" rel="noopener noreferrer"&gt;sensor kits&lt;/a&gt;, but how can data be sent from these devices to Excel?&lt;/p&gt;

&lt;p&gt;This post shows you how to stream data from an IoT device to Excel running on the web!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This post contains links to sample code that you can use with the &lt;a href="https://www.seeedstudio.com/Grove-Kit-with-Raspberry-Pi-4-designed-for-Microsoft-FarmBeats-for-Students-p-4872.html" rel="noopener noreferrer"&gt;FarmBeats for students kit&lt;/a&gt;, available from &lt;a href="https://www.seeedstudio.com/" rel="noopener noreferrer"&gt;Seeed Studios&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynml3d4ekckywpueadxb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynml3d4ekckywpueadxb.png" alt="The architecture of this application. An IoT device exposes an HTTPS REST end point that is consumed by an Excel add-in" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The architecture you can use for this is not that complex. As long as your IoT device has WiFi, you can expose a REST API over HTTPS that can be called by an Excel add-in. This API can then be used to read sensor data, or control actuators.&lt;/p&gt;

&lt;p&gt;Let’s dive in a bit deeper. You can also find all the sample code for this in my &lt;a href="https://github.com/jimbobbennett/farmbeats-vnext-experimental" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  IoT device with a REST API
&lt;/h3&gt;

&lt;p&gt;The Excel add-in JavaScript API can make calls to REST endpoints, including those running on your local network. On your IoT device you can expose a REST API, and from this API return sensor data, or control actuators.&lt;/p&gt;

&lt;p&gt;For example, if you are using a Raspberry Pi with a soil moisture sensor and a relay, you can create a Python/Flask app, and expose a REST API with 2 endpoints:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;temperature/&lt;/code&gt; - make a GET request to this endpoint to get the current reading for the temperature sensor&lt;/p&gt;

&lt;p&gt;&lt;code&gt;relay/&lt;/code&gt; - make a POST request to this endpoint to turn the relay on or off, passing the desired state as a boolean in a JSON request body.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a tip – reading from sensors can take time, and you probably want to avoid multiple concurrent reads to a sensor. A good way to do this is to have a thread that reads and caches sensor values every second or so. When a REST request comes in, read from the cache. This would also allow you to cache historic data, should you want to add an endpoint to get historic data captured when Excel isn’t connected.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Excel add-in architecture also supports web sockets, so you can even expose streaming data over a web socket if you wish.&lt;/p&gt;

&lt;p&gt;One thing you &lt;strong&gt;MUST&lt;/strong&gt; do though, is use HTTPS. Excel add-ins will not work with HTTP, they require a secure endpoint using HTTPS. You can use ad-hoc self-signed certificates, such as by setting the SSL context in a Flask app to &lt;code&gt;adhoc&lt;/code&gt; as described in &lt;a href="https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https" rel="noopener noreferrer"&gt;this blog post&lt;/a&gt;. You also need to run using sudo to use SSL with a flask app on a Raspberry Pi.&lt;/p&gt;

&lt;p&gt;You can find example code for a RaspberryPi that hosts a Flask app with REST endpoints, using the sensors from the FarmBeats for students kit in the &lt;a href="https://github.com/jimbobbennett/farmbeats-vnext-experimental/tree/main/farmbeats-server" rel="noopener noreferrer"&gt;&lt;code&gt;farmbeats-server&lt;/code&gt; folder in my GitHub repo&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Excel add-ins
&lt;/h3&gt;

&lt;p&gt;Excel has an &lt;a href="https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-overview?WT.mc_id=academic-48592-jabenn" rel="noopener noreferrer"&gt;add-in model&lt;/a&gt; that allows you to build add-ins using JavaScript or TypeScript. This allows you to write code that not only uses the &lt;a href="https://docs.microsoft.com/office/dev/add-ins/reference/overview/excel-add-ins-reference-overview?WT.mc_id=academic-48592-jabenn" rel="noopener noreferrer"&gt;Excel JavaScript API&lt;/a&gt; to interact with worksheets, but you can also use standard JavaScript code to do other things - such as interact with the REST endpoint on your IoT device.&lt;/p&gt;

&lt;p&gt;The first step is to create an add-in. There is a handy generator tool to help with this, available on the &lt;a href="https://github.com/OfficeDev/generator-office" rel="noopener noreferrer"&gt;Office Developer GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This tool is installed using NPM, then can be used to create add-ins for any Office app. For Excel, you can create 2 types of add-ins – Task Panes and Excel Functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fazipqyfjcnloje7gtwez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fazipqyfjcnloje7gtwez.png" alt="A task pane in Excel with buttons to stream data and control a relay" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Task Panes are panels that pop out when you select a button on the ribbon. These show HTML pages, with JavaScript or TypeScript code behind the scenes to respond to buttons being selected or other input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyo59l6t7s34w3h1eoz7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyo59l6t7s34w3h1eoz7z.png" alt="Excel with a function in a cell to get the temperature" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Excel Functions are functions in Excel, as the name suggests. You can call these in your spreadsheet the same way that you would call the built-in functions such as &lt;strong&gt;SUM&lt;/strong&gt; and &lt;strong&gt;VLOOKUP&lt;/strong&gt;. Under the hood, it calls functions in your add-in, and these functions can either return a single value, or start a background timer that returns values that update on a regular basis, updating the value in the cell.&lt;/p&gt;

&lt;p&gt;Whichever one you use, your JavaScript or TypeScript code runs inside Excel, so if you are running Excel on the Web via Microsoft 365 for example, this code runs inside your browser locally, not on a server somewhere. This means it can access resources on your local network, such as your IoT device. Inside your button or function code you can then use the JavaScript fetch API to get or set values on your IoT device.&lt;/p&gt;

&lt;p&gt;You can find example code in the &lt;a href="https://github.com/jimbobbennett/farmbeats-vnext-experimental/tree/main/excel-addin" rel="noopener noreferrer"&gt;&lt;code&gt;excel-addin&lt;/code&gt; folder in my GitHub repo&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wiring it all up
&lt;/h3&gt;

&lt;p&gt;Once you have your add-in written, you need to test it all out. Instructions for running and testing your add-in are in the &lt;a href="https://github.com/OfficeDev/generator-office" rel="noopener noreferrer"&gt;generator documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One thing to be aware of is you need to be using Excel on the web, not the local app. This is due to the fun of HTTPS certificates. Unfortunately, there is no way for your IoT device to have a fully valid certificate – certificates are based on the URL of your REST API, and your device is running locally, so won’t have a proper public URL.&lt;/p&gt;

&lt;p&gt;Excel running locally will refuse to access your REST API without a valid certificate, but on the web, you can get your browser to allow the ad-hoc certificate running on your IoT device. What you need to do is to first load one of the REST endpoints in your browser, then when you get a certificate warning, select the option to allow access. You only need to do this once per certificate and after this Excel in the browser will be able to access your IoT device. If you are using Flask for example, every time your Flask app restarts it generates a new certificate, so you will need to re-approve it after every restart.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmtx2cam9j3ai2axkjp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmtx2cam9j3ai2axkjp4.png" alt="A Safari certificate warning" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start by loading the REST API in a browser and approving the certificate.&lt;/p&gt;

&lt;p&gt;Once done, open an Excel workbook in your browser, then load the manifest.xml file for your add-in. You will then be able to access any Task Panes or Excel Functions from your add-in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgs0pnpdc42vtk1fr3ymp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgs0pnpdc42vtk1fr3ymp.png" alt="An Excel workbook with a Task Pane showing with buttons to stream data, and in the sheet is IoT data streamed from an IoT device including current and historic values" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can access from any browser - running on a PC, Mac, Chromebook or iPad!&lt;/p&gt;

&lt;p&gt;If you want to then publish your add-in rather than have it running locally, you will need to host the content somewhere, such as Azure storage. You can find the instructions in the &lt;a href="https://docs.microsoft.com/office/dev/add-ins/publish/publish-add-in-vs-code?WT.mc_id=academic-48592-jabenn" rel="noopener noreferrer"&gt;Excel add-in documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where next?
&lt;/h3&gt;

&lt;p&gt;You can check out sample code to do this in &lt;a href="https://github.com/jimbobbennett/farmbeats-vnext-experimental" rel="noopener noreferrer"&gt;my GitHub repo&lt;/a&gt;. Also check out the &lt;a href="https://docs.microsoft.com/office/dev/add-ins/?WT.mc_id=academic-48592-jabenn" rel="noopener noreferrer"&gt;Office add-ins documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>excel</category>
      <category>iot</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Fun Q&amp;A bot for Microsoft Teams Node.js</title>
      <dc:creator>Rabia Williams</dc:creator>
      <pubDate>Sat, 31 Jul 2021 08:53:57 +0000</pubDate>
      <link>https://dev.to/microsoft365/fun-q-a-bot-for-microsoft-teams-node-js-342e</link>
      <guid>https://dev.to/microsoft365/fun-q-a-bot-for-microsoft-teams-node-js-342e</guid>
      <description>&lt;p&gt;Are you looking for a fun project for your next assignment 🗒?&lt;br&gt;
Did you want to develop a chat bot 💻?&lt;/p&gt;

&lt;p&gt;Then you'll like this little project I am sharing here with you, whether you want to deep dive into the details or not 😉. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I can use a BOT to put a question or a thought in the Microsoft Teams channel/group chat conversation.&lt;/li&gt;
&lt;li&gt;My team mates can respond to the question with a form to put free text in.&lt;/li&gt;
&lt;li&gt;I can check how many team mates responded in the same card with their responses, real time. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🚀🚀🚀 End result?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjqtzxdcc0rwxqk9p2eyo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjqtzxdcc0rwxqk9p2eyo.gif" alt="uam"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💻💻💻 Source&lt;/strong&gt;&lt;br&gt;
Check out the full source code here &lt;a href="https://github.com/rabwill/cardBot-TS" rel="noopener noreferrer"&gt;https://github.com/rabwill/cardBot-TS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📙📙📙 Read the article&lt;/strong&gt;&lt;br&gt;
If you wanna deep dive into how it is developed checkout my original blog post here 👉🏽&lt;a href="https://rabiawilliams.com/teams/uam-bot/" rel="noopener noreferrer"&gt;https://rabiawilliams.com/teams/uam-bot/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>msteams</category>
      <category>node</category>
      <category>vscode</category>
      <category>bot</category>
    </item>
    <item>
      <title>Create Azure AD apps from the manifest</title>
      <dc:creator>Waldek Mastykarz</dc:creator>
      <pubDate>Thu, 22 Apr 2021 11:59:19 +0000</pubDate>
      <link>https://dev.to/microsoft365/create-azure-ad-apps-from-the-manifest-3l8n</link>
      <guid>https://dev.to/microsoft365/create-azure-ad-apps-from-the-manifest-3l8n</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LvVry9fS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mastykarz.nl/assets/images/2021/01/banner-cli-m365-aad-app-add.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LvVry9fS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mastykarz.nl/assets/images/2021/01/banner-cli-m365-aad-app-add.png" alt="Create Azure AD apps from the manifest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Did you ever want to create Azure AD applications from their manifest? Now you can with CLI for Microsoft 365.&lt;/p&gt;

&lt;h2&gt;
  
  
  The easiest way to create Azure AD apps
&lt;/h2&gt;

&lt;p&gt;Recently, I wrote about &lt;a href="https://dev.to/create-azure-ad-apps-one-line-code/"&gt;how CLI for Microsoft 365 simplifies creating Azure AD apps&lt;/a&gt;. With just one command, you can create a new Azure AD app registration configured with the necessary authentication settings, API permissions and more.&lt;/p&gt;

&lt;p&gt;When you build apps on Microsoft 365, you need an Azure AD app registration for your app. The app registration represents your app on the Microsoft cloud and defines the authentication capabilities and API permissions of your app.&lt;/p&gt;

&lt;p&gt;Because &lt;a href="https://docs.microsoft.com/learn/modules/getting-started-identity/?WT.mc_id=m365-26011-wmastyka"&gt;Azure AD apps play such an important role&lt;/a&gt;, we thought that we should simplify creating them, so that you can focus on building your app. If you script deploying your app between the different environments but also in your team, including CLI for Microsoft 365 will help you include the creation of the Azure AD app registration while keeping your script simple.&lt;/p&gt;

&lt;p&gt;With CLI for Microsoft 365, we brought down creating Azure AD apps to just one command. But we didn't stop there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Azure AD app registrations from manifest
&lt;/h2&gt;

&lt;p&gt;When building apps for Microsoft 365, you typically start by creating an Azure AD app registration. Without it, your app won't be able to connect to Microsoft 365. While developing your app, the easiest way to create and configure your Azure AD app is through the Azure Portal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wmswP8kR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mastykarz.nl/assets/images/2021/04/azure-portal-ad-app-registration.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wmswP8kR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mastykarz.nl/assets/images/2021/04/azure-portal-ad-app-registration.png" alt="Azure AD app registration registration in the Azure Portal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Azure Portal lets you easily create the app registration and configure it to match your needs. But then what, how do you share this configuration with your fellow developers or customers?&lt;/p&gt;

&lt;p&gt;In CLI for Microsoft 365 v3.9 (available as preview when writing this article), we introduced support for creating Azure AD app registrations from their manifest. After you created and configured Azure AD app registration in the Azure Portal, go to the &lt;strong&gt;Manifest&lt;/strong&gt; tab, copy the manifest's contents and save them to a file in your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2yndY4Er--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mastykarz.nl/assets/images/2021/04/azure-portal-ad-app-manifest.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2yndY4Er--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blog.mastykarz.nl/assets/images/2021/04/azure-portal-ad-app-manifest.png" alt="Azure AD app registration manifest in the Azure Portal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, after signing in to the tenant where you want to create your app, execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;m365 aad app add &lt;span class="nt"&gt;--manifest&lt;/span&gt; @manifest.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. CLI for Microsoft 365 will take the manifest you specified and create a new Azure AD app registration with the specified configuration. If you prefer to separate configuration from code, you'll love this approach!&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;p&gt;There are some limitations related to creating Azure AD apps from the manifest that you should take into account.&lt;/p&gt;

&lt;p&gt;First, if you granted your Azure AD app permissions to custom APIs that are registered in one directory, their IDs will by likely different when you create the app registration in another directory. You can work around it, by removing the tenant-specific API permissions from the manifest, and grant them using the &lt;code&gt;apisDelegated&lt;/code&gt; option, like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;m365 aad app add &lt;span class="nt"&gt;--manifest&lt;/span&gt; @manifest.json &lt;span class="nt"&gt;--apisDelegated&lt;/span&gt; &lt;span class="s1"&gt;'https://contoso.microsoft.com/App.Read'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another thing you should consider is, that when you look at the manifest that you copy from the Azure Portal, there are some properties that are not supported by Microsoft Graph which we use to create the app. The command automatically removes them from the manifest so that it can create the app registration but some settings will be missing in the created app.&lt;/p&gt;

&lt;p&gt;Since we've just introduced this functionality in the v3.9 beta version of CLI for Microsoft 365, we'd love for you to give it a try and tell us what you think. Does it work? Do we miss something important? Is there anything that we should reconsider?&lt;/p&gt;

&lt;p&gt;To see what's possible, see the &lt;a href="https://pnp.github.io/cli-microsoft365/cmd/aad/app/app-add/"&gt;command's docs&lt;/a&gt;. Looking forward to hearing from you.&lt;/p&gt;

</description>
      <category>azureactivedirectory</category>
      <category>azuread</category>
      <category>climicrosoft365</category>
      <category>microsoft365</category>
    </item>
    <item>
      <title>Develop intuitive apps with Microsoft 365 data</title>
      <dc:creator>Rabia Williams</dc:creator>
      <pubDate>Sun, 28 Feb 2021 23:41:51 +0000</pubDate>
      <link>https://dev.to/microsoft365/develop-intuitive-apps-with-microsoft-365-data-4nn8</link>
      <guid>https://dev.to/microsoft365/develop-intuitive-apps-with-microsoft-365-data-4nn8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PMw_kRKC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5evi16szsu056tmyghn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PMw_kRKC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5evi16szsu056tmyghn.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
If you have been using any Microsoft 365 products in your day-to-day life, then you are already using Microsoft Graph.&lt;br&gt;
Microsoft Graph is the data and insights that describe the patterns of productivity in an organization, accessed through a &lt;br&gt;
unified API endpoint. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Microsoft Graph powers Microsoft products&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are thousands of datasets that power first party Microsoft products, available to you to extend your applications to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query the structure &lt;/li&gt;
&lt;li&gt;Get information about the user&lt;/li&gt;
&lt;li&gt;Access files, calendars, Planner plans, etc. within the Team&lt;/li&gt;
&lt;li&gt;Act on behalf of a user&lt;/li&gt;
&lt;li&gt;Access content&lt;/li&gt;
&lt;li&gt;Add relevance and intelligence
..and many more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So did you just want to build an application in the Microsoft365 platform or did you want to leverage all the data that is available to you, so you can build smarter applications that is well informed with what the user does, needs and proactively make decisions to make user's day to day life more productive.&lt;br&gt;
Find out more here on &lt;a href="https://developer.microsoft.com/en-us/graph/blogs/microsoft-graph-mailbag-intro-to-microsoft-graph-and-top-5-api-requests/"&gt;Microsoft Graph Mailbag series&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>microsoft365</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
