https://discord.gg/botpress logo
#🤝help
Dynamic Carousel with n number of cards
# 🤝help
l

lemon-shampoo-32725

07/17/2023, 9:55 PM
Is it possible to call an API, retrieve the results, and dynamically populate a carousel with cards? I have access to the API's data, including the photo URL, but I'm unsure how to handle generating an unknown number of cards. For instance, suppose I invoke a real estate API and receive a response containing listing data such as addresses, photo URLs, and other fields. In this scenario, the API returns 42 listings. My objective is to iterate through each of these listings and populate the carousel with corresponding cards. If there are indeed 42 listings, I intend to display 42 cards within the carousel. Any code samples would be great or I can share my code. It would be a huge breakthrough for me if I could implement this functionality on my bot. Please let me know of any additional information you might need from me.
13 Views