OutSystems Developer Advocate
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: Builds --- # Super Fun Chatbot Build (15 Mins) With IBM Watson and OutSystems Author: [@sydneylai](https://twitter.com/sydneylai) Video Tutorial [[LINK]](https://www.youtube.com/watch?v=fl_ZHT8ZspU) </br> **Scope of this Tutorial** This example will demonstrate how to build your own IBM Watson Assistant chatbot, and integrate that with your OutSystems reactive web build! You will walk through how to structure intents, entities, dialog, and how to launch this feature in a web app.This app is crazy fun to build, with only a few drag and drops, copy and paste, you have yourself an awesome chatbot. **Finished Demo:** [![](https://i.imgur.com/H8zVOyN.jpg)](https://sydneylai-dev.outsystemscloud.com/MartianComms/Home?_ts=637297249077553705) ✌️🛸👽 Space travel is cool but what if we can chat with Aliens? When we think of AI-driven bots, the mystery behind their interactive user-experience seems almost alien to us! Besides out of world experiences, chatbots are used across industries in logistics, financial services, customer service, and even disaster relief. There’s no wifi in space yet, so creating an AI bot to speak with Aliens might just be the first step in our imaginations. **PART 1/2: IBM Chatbot Build** Have an account at IBM: [IBM Sign-up](https://cloud.ibm.com/registration?target=/developer/watson/launch-tool/conversation&hideTours=true&cm_sp=WatsonPlatform-WatsonPlatform-_-OnPageNavCTA-IBMWatson_Conversation-_-Watson_Developer_Website&cm_mmca1=000027BD) Step 1. get services - look for Watson Assistant in the Catalog. ![](https://i.imgur.com/E8EvfBm.png) Select Watson Assistant and create a service, you in Dallas. Step 2. Building the algorithm Create an Assistant named "Martian Comms", and then create a Dialog Skill ![](https://i.imgur.com/NaTVWRj.png) We will create a conversation, map out on a piece of paper how you want the conversation to progress. For this Alien communication app, we can have a fun dialog such as: > Alien Bot: Hello. I'm an alien from Mars. Are you a human on Earth? > Human: INTENTS (Ex: #Confirmation) > > Alien Bot: Well then, how about I transport you to Mars to confirm my existence? > Human: INTENTS (Ex: #Confirmation) > > Alien Bot: I will send my UFO to fetch you, what is your zip code? > Human: ENTITIES (Ex: @zip_code:US Zip) > > Alien Bot: Location Confirmed. To identify you, what is your eye color? > Human: INTENTS (Ex: #eye-color) > > Alien Bot: What a tragic color. Confirmed. I will greet you soon. Goodbye. > > END Now that you've written out your script, you can build out Intents, Entities and Dialog in your Watson dashboard. Step 3: Building Intents ![](https://i.imgur.com/NuHBpxQ.png) Click-on "Create an Intent" button and fill out an Intent Name starting with a hashtag, and start inputting responses that fit your likely responses. You can expand your word base by selecting "Show Recommendations" Where the machine learning comes into play, is the more you teach Watson your intents, language, and words, the system analyzes learned words for further recommendations. ![](https://i.imgur.com/BgKxzTk.png) Now create an Intent for #eye_color and lists eye colors. Step 4: Building Entities ![](https://i.imgur.com/7cpYHYp.png) Create your Zip code entites ![](https://i.imgur.com/Ix7fqfL.png) Use `(\b|\s)\d{5}(\b|\s)` to tell the Pattern type that it will be a 5 digit zip code for the US standard. Step 5: Creating Dialog ![](https://i.imgur.com/pTI5NNN.png) You can start mapping out your dialog. Give your Dialog Node a Title, and indicate what you want your assistant to recognize, how you want your assistant to respond, and what you want your assistant to do next. Your Assistant could recognize #Confirmations or @zip_code Step 6: Connect the chatbot backend to a web app or mobile ![](https://i.imgur.com/FnWMGpS.png) Head over to Integrations to find your auto-generated Javascript code. Embed the chat UI into any website pages where you want. Here is a sample code [This code will expire after I discontinue IBM Cloud hosting] ``` <script> window.watsonAssistantChatOptions = { integrationID: "e3cfdf78-9116-474f-8c58-6384f4064ba4", // The ID of this integration. region: "us-south", // The region your integration is hosted in. serviceInstanceID: "c2bd0850-d464-4b05-9eef-810be2df29b7", // The ID of your service instance. onLoad: function(instance) { instance.render(); } }; setTimeout(function(){ const t=document.createElement('script'); t.src="https://web-chat.global.assistant.watson.appdomain.cloud/loadWatsonAssistantChat.js"; document.head.appendChild(t); }); </script> ``` **PART 2/2: Build the Web app** Build and launch your web app in a few clicks: [OutSystems](https://www.outsystems.com/downloads/) Step 7: Create a Module Once your OutSystems IDE is installed, click on "New Application" to build your app, and then click on "Add Module" and select Reactive Web from the dropdown. Step 8: Create Front-end Screen ![](https://i.imgur.com/Wq6caoF.png) In your MainFlow, right-click to create a Screen, title it "Home" and check-off Role > Anonymous and Public set to Yes so that others regardless of login or roles and see your page. Set your Events to OnReady, where it is triggered when you have most of the page resources ready (data, UI elements). Step 9: Insert JS script ![](https://i.imgur.com/qyQ3suh.png) To Insert your Watson Chatbot Javascript, click on OnReady. Find your Javascript widget on the left-hand side and drag that component to your logic. Double-click to open the screen and copy and paste your JS script from your Watson dashboard. OutSystems automatically compiles the script, so you can remove ``` <script> </script> ``` from the beginning and end of your code. **REMEMBER: Save & Publish** Above, click on the green One-Click Publish button and then the blue arrow to see your chatbot integrated into your web app. Step 10: Design Double-click on your Home screen, and drag and drop a container onto the screen. ![](https://i.imgur.com/7IARpvX.png) You can also drag an Image widget and upload images Here's an example Giphy: https://giphy.com/gifs/alien-et-aliens-xTiTnBSIn7vTqCDKJW **Save and Publish Once More**, now play with your Alien chat app!

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully