Versions Compared

Key

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

Adaptive Cards can be used to build and customize a variety of content. One of which is displaying Login in a Card. Read more about Adaptive Cards here.Adaptive Cards

In this document, we will give you a sample code for a login card.

...

Code Block
var _ = global.get('lodash');

var index = _.findIndex(msg.payload.orbita.directive, { type: 'adaptivecard'});

var adaptiveCard = _.find(msg.payload.orbita.directive, { type: 'adaptivecard'});

adaptiveCard.template.actions = [
            {
                "type": "Action.Submit",
                "title": "Login",
                "style": "positive",
               
                "data": {
                  "serviceCall": {
                    "url": "<Login directive tab URL goes here>",
                    "type": 'POST',
                     "orbitaAction": 'login',
                     "loginSuccessUtterence": "success",
                     "successCallback": "function()​​{ /*Custom business logic*/ }" 
                  }
                }
            }
        ]
            
msg.payload.orbita.directive[index] = adaptiveCard;

return msg;

...