Card Carousel and looping till the end of database

How can I pass the looped data in domain. Does domain support loops?

responses:
  utter_cards_carousel:
    custom:
      payload: cardsCarousel
      data:
      - image: https://b.zmtcdn.com/data/pictures/1/17428541/da50010b1a953dfbb109306fba5a6c06.jpg
        name: abc
        ratings: '4.0'
        title: pqr
      - image: https://b.zmtcdn.com/data/pictures/1/17428541/da50010b1a953dfbb109306fba5a6c06.jpg
        name: abc
        ratings: '4.0'
        title: pqr
  data = {
        "payload": 'cardsCarousel',
        "data": [
            {
                "image": "https://b.zmtcdn.com/data/pictures/1/18602861/bd2825ec26c21ebdc945edb7df3b0d99.jpg",
                "title": "Taftoon Bar & Kitchen",
                "ratings": "4.5",
            },
            {
                "image": "https://b.zmtcdn.com/data/pictures/4/18357374/661d0edd484343c669da600a272e2256.jpg",

                "ratings": "4.0",
                "title": "Veranda"
            }
dispatcher.utter_message(json_message=data)

In this context how can I send all the data from database into this card carousel by using a loop and not having to code every details?