Versions Compared

Key

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

...

Code Block
msg.payload.orbita.directive= [{  
    "type": "button",
    "buttons": [
        {
            "type" : "js",
            "text": "Button with script",
            "value": `
                if (navigator.geolocation) {
                    navigator.geolocation.getCurrentPosition(showPosition);
                } 
                else { 
                    console.log("Geolocation is not supported by this browser.");
                    callback({utterance: "help"});
                }
                function showPosition(position) {
                    console.log("Latitude: " + position.coords.latitude + 
                        "<br>Longitude: " + position.coords.longitude);
                        callback({utterance: "help", data: [position.coords.latitude, position.coords.longitude]});
                }
            `,
        }
    ]
}];
return msg;   

Usage

If you want a button to display when the help intent is triggered. Place a function node as shown in the below screenshot and place any of the sample codes given in this document.

...

Attachments
previewfalse
oldfalse
patterns.*json

Related Articles

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