I have created one custom function, but its not reflecting in the chat

I am trying to create a custom card, but its not reflected in a chat while execution.

here is my function


return new Promise (resolve => {

// Your Logic goes here

let arr= ;

let tracard=

{

title: “Track Order”,

statuses: [“Order Accepted”, “Preparing Your Order”,

“Despatched”, “Arrived”, “Delivered”],

currentstatus : “Pending”,

details: {

“Order Details” : “Sample text”,

“Order ID”: “1”,

“Delivey”: “14/12/2021”,

“Total”: “1k”,

},

};

arr.push(tracard);

resolve(arr);

});


Please suggest a resolution on this


image

Hi @OM_PAWAR can you let us know which card you are trying to implement.

You can refer to this doc - Implement New Card in Yellow AI Cloud Platform | yellow.ai for implementing various cards in web bot

I am trying to use the Tracker card

Hi @OM_PAWAR

You can use below snippet

return new Promise(resolve => {
    // Your logic goes here
    let arr= [];
    let tracard =
            {
                "title": "Track Order",
                "statuses": ["Ordered", "Ready", "Shipped", "In City", "Arrived"],
                "currentStatus": "Shipped",
                "from": { "Title": "Jakarta", "Description": "12/12/2021" },
                "to": { "Title": "Surabaya", "Description": "14/12/2021" },
                "assigneeDetails": {
                    "key": "Name",
                    "value": 'Novi Andari',
                    "image": "https://cdn.yellowmessenger.com/q9f6PUO48xbV1617021384235.jpeg",
                },
                "details": {
                    "Order ID": "#444-2445-2442-222",
                    "Delivey": "14/12/2021",
                    "Total": "IDR 1500",
                },
                //  "actions": {
                //    title: "View data",
                //  text: "View data"
            };
            arr.push (tracard);
    resolve(arr);
});   

Store the response in a variable of type array.

Create a carousel node delete the card in it click on settings icon inside the carousel card and use the card type as Order tracker.

After this using fetch from option fetch the array variable in which card data is stored.