Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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.

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.

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.

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.

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.

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

Invoke the intent in the Chatbot.

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.

Add the below code to the function node.

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.

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

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

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

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

  • No labels