LPL
Voiceflow Partnersβ€’7mo agoβ€’
1 reply
LP

Hey all. Can't get a button to open a link in a new tab.

Looking at my chat and trying to get this button that says Book Unit to open the link. It's showing up in the console but won't do anything when clicked. Any ideas? Here's my code

carousel = {
layout: 'Carousel',
cards: []
};

const carouselItems = apiResponse.records;

const carouselCard = (Size, Climate_Control, Price, Available_Date, Booking, Image) => ({
title:
${Size}
,
description: {
text:
Climate control: ${Climate_Control} Price: ${Price}

},
imageUrl: Image,
buttons: [
{
name: 'Book Unit',
request: {
type: 'open_url',
payload: {
actions: [{ type: 'open_url', payload: { url: Booking } }]
}
}
}
]
});

carouselItems.forEach(item => {
const fields = item.fields;
carousel.cards.push(carouselCard(
fields.Size,
fields.Climate_Control,
fields.Price,
fields.Available_Date,
fields.Booking,
fields.Image
));
});

carousel = JSON.stringify(carousel);
image.png
Was this page helpful?