Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A yet another code-free environment to design and build new directives. This easy to use interface will let you build engaging cards, for your chatbots, using drag and drop elements and customizable properties.

Table of Contents

Why Adaptive cards?

Our goal is to provide you with all the necessary tools and packages that will help you develop visually attractive and engaging content for your chatbot. A step forward in this direction is the introduction of Adaptive Cards.

Using Adaptive Cards you can design intuitive and appealing cards for your chatbot that are not feasible with the traditional directives.

For example, you can create a date range picker, an amelioration of Orbita’s existing date picker directive.

Image Modified

Orbita’s Adaptive Cards

If you have a Sample design in mind, you can create an Adaptive card from scratch. Else, you can get started with any of the sample cards from https://adaptivecards.io/samples/ and tweak them to your liking.

You will find the adaptive cards at Experience Manager > Project > Side Menu > Hierarchy icon > Adaptive cards.

Click on the (plus) plus icon at the bottom of the page to create a new Adaptive Card.

Give a Title and Description to the card you are about to create.

Image Modified

You will land on the Adaptive Cards designer. It contains:

  1. Elements Palette - All the basic elements to create an attractive card for your chatbot.

  2. Canvas - You will drag and drop the elements from the Elements Palette to the Canvas. This is where you will design your card.

  3. Element Properties - Each element have customizable properties. You can edit them here.

  4. Custom Data Editor - You can set dynamic data content here and use them in the Elements.

  5. Card Payload Editor - The Final JSON code of the card you designed. This payload can be copied to the msg.payload.orbita.directive array in a function node to use the card in the Experience Designer.

Image Modified

Using Adaptive Cards in Experience Designer

There are two ways to use Adaptive Cards in Experience Designer.

  1. Using Adaptive Card node. (Refer to Adaptive Card node documentation)

  2. Using the Card Payload code as a directive in a function node.

Using the Adaptive card node

Add an Adaptive Card node to the flow.

Image Modified

In the Adaptive Card node, select the Card you want to display.

Image Modified

Invoke the intent in the Chatbot.

Image Modified

Using the Card Payload

If you want to add additional functionality to the card such as invoking an intent after one card is submitted, you can do it by using the Card Payload as a directive in a function node.

Add a function node to the flow.

Image Modified

Add the below code to the function node.

Code Block
if(!msg.payload.orbita) {
    msg.payload.orbita = {};
}
if(!msg.payload.orbita.directive) {
    msg.payload.orbita.directive = [];
}
msg.payload.orbita.directive.push(
    {
    "type": "adaptivecard",
    "template": {
        //*****Paste the code from Card Payload Editor*****        
    },
    "templateData": {
        //*****Paste the code from Custom Data Editor*****        
    },
    "hostAppName": {
        "name": "default"
    }
})

Getting the template and templateData properties

You can get the template code from the Adaptive Cards Designer > Card Payload Editor.

Image Modified

Paste the code inside the template object in the function node.

Image Modified

You can get the templateData code from the Adaptive Cards Designer > Custom Data Editor.

Image Modified

Paste the code inside the templateData object in the function node.

Image Modified

Invoking an intent after the card submit

In the Function node, find Actions property and add eventName property.

Add the same event name to the Intent you want to fire upon submitting this card.

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "experience-manager"