dry-scarletD
Voiceflow Partners9mo ago
1 reply
dry-scarlet

Carousel with buttons that set a variable

I'm dynamically creating carousel cards in a function in this way:

responseData.forEach( ( object ) => {
carousel.cards.push( {
imageUrl: 'https://image.thum.io/get/ogImage/noanimate/',
title: object.size + ' - Starts at ' + object.price,
description: {
text: 'Rent To Own Available'
},
buttons: [
{
"name": "Monthly Prices + Features",
"request": {
"type": "url-button",
"payload": {
"label": "Read More",
"actions": [
{
"type": "open_url",
"payload": {
"url": "https://google.com"
}
}
]
}
}
}
]
} )

} )


Instead of having an URL button, I want a button that sets a variable with the object (or can be multiple variables with each of the objects properties). Is there any documentation or perhaps a template that shows how this can be done?
Was this page helpful?