title: How to create a carousel with a loop Microsoft Bot Framework
body: <p>Trying to create a carousel using <strong>JSON</strong> returned from an API. I'm trying to return one carousel with multiple images and you can scroll across to look at all images. I'm pretty sure it's something small I'm missing, any help is much appreciated.</p>
  
  <pre><code>                    RootObject result = JsonConvert.DeserializeObject&lt;RootObject&gt;(apiResponse);
  
                      var card = new HeroCard { };
  
                      List&lt;CardImage&gt; cardImages = new List&lt;CardImage&gt;();
                      var reply = context.Activity.CreateReply();
                      Attachment plAttachment;
  
                      for (int i = 0; i &lt; 5; i++)
                      {
                          cardImages.Add(new CardImage(url: "https://image.tmdb.org/t/p/original" + result.results[i].poster_path));                           
                      }
  
                      for (int x = 0; x &lt; 5; x++)
                      {
                          HeroCard plCard = new HeroCard()
                          {
                              Text = "Test",
                              Title = "Movies",
                              Images = cardImages,
  
                          };
                          plAttachment = plCard.ToAttachment();
                          reply.Attachments.Add(plAttachment);
                      }
                      reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                      await context.SendActivityAsync(reply);
                  }
              }       
          }
  
          catch (Exception ex)
          {
  
          }
  }
  </code></pre>
  
  <p>At the moment its returning multiple carousels with the same image:
  <img src="https://i.stack.imgur.com/IG2UJ.png" alt="Bot Reply"></p>