Dynamic carousel
const carouselCards = records.map(record => ({
title: record.fields.Product,
description: { text:
€${record.fields.Price} },imageUrl: record.fields.Photo,
buttons: [
{
name: "More details",
request: {
type: "open_url",
payload: {
url: record.fields.Link
}
}
}
]
}));
// Return to Voiceflow with carousel trace and next path
return {
next: { path: "success" },
trace: [{
type: "carousel",
payload: {
cards: carouselCards
}
}]
};

