Product list
The product list data type allows posting a list of images, titles, and descriptions dynamically to the display or input carousel card. From this, you can fetch a list of product elements (image, title, and description) from third-party applications and pass them in the product list datatype to display these products in the carousel cards.
Note: The product list is available only on the Output parameter.
Example: Displaying a list of trips in a tourism industry
- Initiate an output parameter with the datatype as the Product list.
- In the plug, write the logic to fetch a list of trips (product) along with its name, image, and description.
- Pass these trips (product) list in the product list datatype and publish the plug.
- Add this published plug to the bot builder and provide a context variable for the plug output parameter.
- Next, select the carousel card and click Dynamic as the card type.
- Choose the context variable and click Save.
Elements | Description | Example |
id | The ID of the product | "id": "switzerland" |
title (2) | The heading/title of the product | "title": "Switzerland: Unveil Alpine Wonders" |
subtitle (3) | The description of the product | "subtitle": "Indulge in the breathtaking beauty of Switzerland's snow-capped peaks, serene lakes, and charming villages." |
image (1) | The image URL of the product | Image URL |
action (4) | The follow-up action, buttons for the Input carousel, and URLs for the Display carousel. | Action for Input carousel, "actions": [ Action for Display carousel, "actions": [ |
Reference
Sample Code
Copied{
"elements": [
{
"title": "Switzerland: Unveil Alpine Wonders",
"subtitle": "Indulge in the breathtaking beauty of Switzerland's snow-capped peaks, serene lakes, and charming villages. Immerse yourself in the heart of the Alps, where adventure and relaxation intertwine. Experience world-class skiing, explore picturesque cities, and savor Swiss chocolate in its birthplace. Your journey to Switzerland promises unforgettable moments amidst nature's grandeur",
"id": "switzerland",
"image": "https://images.unsplash.com/photo-1530122037265-a5f1f91d3b99?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8c3dpdHplcmxhbmR8ZW58MHx8MHx8fDA%3D&w=1000&q=80",
"actions": [
{
"label": "Get Packages",
"name": "getpackage"
},
{
"label": "Customer Showcase",
"name": "customershowcase"
}
]
},
{
"title": "Greece: Embrace Myth and Majesty",
"subtitle": "Step into the realm of ancient gods and mythical tales as you wander through Greece's rich history. From the iconic ruins of Athens to the pristine beaches of the islands, Greece offers a tapestry of experiences. Explore ancient temples, relish Mediterranean cuisine, and bask in the warmth of Greek hospitality. Each corner of Greece invites you to create your own legendary adventure.",
"id": "greece",
"image": "https://media.istockphoto.com/id/1145450965/photo/santorini-island-greece.jpg?s=612x612&w=0&k=20&c=AY_kxRrkTjbDLhqpotxgW8CZp4ovEIM1tRdTrvXKcAM=",
"actions": [
{
"label": "Get Packages",
"name": "getpackage"
},
{
"label": "Customer Showcase",
"name": "customershowcase"
}
]
},
{
"title": "Netherlands: Discover Dutch Delights",
"subtitle": "Uncover the Netherlands' unique blend of tradition and innovation. Windmills, tulips, and picturesque canals await in charming cities like Amsterdam and Utrecht. Immerse yourself in art and culture at world-renowned museums, and cycle through scenic landscapes that epitomize Dutch charm. With its blend of old-world charm and modern allure, the Netherlands is a canvas of colors waiting to be explored.",
"id": "netherlands",
"image": "https://img.traveltriangle.com/blog/wp-content/uploads/2017/11/Places-To-Visit-In-Netherlands_15th-jun.jpg",
"actions": [
{
"label": "Get Packages",
"name": "getpackage"
},
{
"label": "Customer Showcase",
"name": "customershowcase"
}
]
},
{
"title": "Maldives: A Tropical Paradise Beckons",
"subtitle": "Discover the Maldives, where crystal-clear waters, white sandy beaches, and vibrant coral reefs create a heavenly oasis. Relax in luxurious overwater bungalows, snorkel amidst colorful marine life, and unwind under palm trees swaying in the gentle breeze. In this secluded paradise, every moment is a postcard-worthy experience, offering tranquility and rejuvenation like nowhere else.",
"id": "maldives",
"image": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.travelawaits.com%2F2468649%2Fhow-to-visit-the-maldives%2F&psig=AOvVaw3pZQcXRfTF2IDGk5Hix2U3&ust=1693054506970000&source=images&cd=vfe&opi=89978449&ved=0CBAQjRxqFwoTCNjYycPt94ADFQAAAAAdAAAAABAJ",
"actions": [
{
"label": "Get Packages",
"name": "getpackage"
},
{
"label": "Customer Showcase",
"name": "customershowcase"
}
]
}
]
}
Plug Script (Deluge)
Copiedresponse = Map();
actions = {{"label":"Get Packages","name":"getpackage"}};
switzerland = Map();
switzerland.put("title","Switzerland: Unveil Alpine Wonders");
switzerland.put("subtitle","Indulge in the breathtaking beauty of Switzerland's snow-capped peaks, serene lakes, and charming villages. Immerse yourself in the heart of the Alps, where adventure and relaxation intertwine. Experience world-class skiing, explore picturesque cities, and savor Swiss chocolate in its birthplace. Your journey to Switzerland promises unforgettable moments amidst nature's grandeur");
switzerland.put("id","switzerland");
switzerland.put("image","https://images.unsplash.com/photo-1530122037265-a5f1f91d3b99?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8c3dpdHplcmxhbmR8ZW58MHx8MHx8fDA%3D&w=1000&q=80");
switzerland.put("actions",actions);
greece = Map();
greece.put("title","Greece: Embrace Myth and Majesty");
greece.put("subtitle","Step into the realm of ancient gods and mythical tales as you wander through Greece's rich history. From the iconic ruins of Athens to the pristine beaches of the islands, Greece offers a tapestry of experiences. Explore ancient temples, relish Mediterranean cuisine, and bask in the warmth of Greek hospitality. Each corner of Greece invites you to create your own legendary adventure.");
greece.put("id","greece");
greece.put("image","https://media.istockphoto.com/id/1145450965/photo/santorini-island-greece.jpg?s=612x612&w=0&k=20&c=AY_kxRrkTjbDLhqpotxgW8CZp4ovEIM1tRdTrvXKcAM=");
greece.put("actions",actions);
netherlands = Map();
netherlands.put("title","Netherlands: Discover Dutch Delights");
netherlands.put("subtitle","Uncover the Netherlands' unique blend of tradition and innovation. Windmills, tulips, and picturesque canals await in charming cities like Amsterdam and Utrecht. Immerse yourself in art and culture at world-renowned museums, and cycle through scenic landscapes that epitomize Dutch charm. With its blend of old-world charm and modern allure, the Netherlands is a canvas of colors waiting to be explored.");
netherlands.put("id","netherlands");
netherlands.put("image","https://img.traveltriangle.com/blog/wp-content/uploads/2017/11/Places-To-Visit-In-Netherlands_15th-jun.jpg");
netherlands.put("actions",actions);
maldives = Map();
maldives.put("title","Maldives: A Tropical Paradise Beckons");
maldives.put("subtitle","Discover the Maldives, where crystal-clear waters, white sandy beaches, and vibrant coral reefs create a heavenly oasis. Relax in luxurious overwater bungalows, snorkel amidst colorful marine life, and unwind under palm trees swaying in the gentle breeze. In this secluded paradise, every moment is a postcard-worthy experience, offering tranquility and rejuvenation like nowhere else.");
maldives.put("id","maldives");
maldives.put("image","https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.travelawaits.com%2F2468649%2Fhow-to-visit-the-maldives%2F&psig=AOvVaw3pZQcXRfTF2IDGk5Hix2U3&ust=1693054506970000&source=images&cd=vfe&opi=89978449&ved=0CBAQjRxqFwoTCNjYycPt94ADFQAAAAAdAAAAABAJ");
maldives.put("actions",actions);
cards = List();
cards.add(switzerland);
cards.add(greece);
cards.add(netherlands);
cards.add(maldives);
destinations = Map();
destinations.put("elements",cards);
response.put("productlistoutput",destinations);
return response;