# Dynamic Carousel Action

This action will display a dynamically generated carousel based on standard Connect Action Model Json content from either a Url or a variable.

![](https://content.gitbook.com/content/tZEstFBYh3uMutlup6ku/blobs/h2yTRpbd61Gf3bSHDHSv/image.png)

### Settings

The action uses the following settings:

| Setting                             | Description                                                                                              | [Parsed](https://docs.mylinkconnect.com/actions-and-operations/dynamic-parsing) |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Data Source                         | Select if the dynamic carousel data model will be downloaded from an Url or retrieved from a variable.   | :no\_entry:                                                                     |
| Xenioo Action Model URL             | The Url from which the dynamic carousel data will be retrieved.                                          | :white\_check\_mark:                                                            |
| Xenioo Action Model Variable Source | The variable that holds the dynamic carousel model.                                                      | :white\_check\_mark:                                                            |
| Postback target variable            | The variable that will hold any postback command caused by postback buttons inside the dynamic carousel. | :white\_check\_mark:                                                            |
| Default Image Source                | The source of the default card image, if non is supplied inside the model.                               | :no\_entry:                                                                     |
| Default Element Image               | The url of the image to be used as default card image.                                                   | :white\_check\_mark:                                                            |

### Remarks

The Dynamic Carousel Action will be activated by a very specific JSON model that represents the carousel cards and buttons. The model can be retrieved from an external source or from a [runtime variable](https://docs.mylinkconnect.com/actions-and-operations/variables-and-tags).

The following source shows a brief sample of a complete dynamic carousel JSON:

```javascript
{
  "image_aspect_ratio":"horizontal",
  "items":[
      {
	        title: "Chevrolet Corvette",
	        subtitle: "Buy your Chevrolet Corvette!",
	        image_url:"https://someserver.com/corvette.jpg",
			view_size:"compact",
	        buttons:[
	          {
	              type:'postback',
		          payload: "buy_corvette",
		          text:'Buy Now'
	          },
	          {
	              type:'url',
		          url: "https://www.chevrolet.comr",
		          text:'Visit Website',
			      view_size:'full'
	          }
          ]
      }
  ]
}
```

The above items collection holds all of the different cards that will be created dynamically. \
The *view\_size* parameter can have the following values:

| Value   | Description                                                              |
| ------- | ------------------------------------------------------------------------ |
| compact | The web view will be about half the size of the available mobile screen. |
| tall    | The web view will cover most of the available mobile screen.             |
| full    | The webb view will be full screen.                                       |

The *image\_aspect\_ratio* parameter can have the following values:

| Value      | Description                               |
| ---------- | ----------------------------------------- |
| horizontal | The image will have a 1:1.91 aspect ratio |
| square     | The image will have a 1:1 aspect ratio.   |

Aspect ratio parameter is currently supported on on [Facebook Messenger channel](https://docs.mylinkconnect.com/basic-concepts/publishing/channels/facebook).

The *type* parameter for each button can have the following values:

| Value    | Description                                                                                                                                                              |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| postback | Defines a [postback ](https://docs.mylinkconnect.com/actions-and-operations/cards/additional-buttons/xenioo.bots.actions.base.operations.buttonpostbackoperation)button. |
| url      | Defines an [Url ](https://docs.mylinkconnect.com/actions-and-operations/cards/additional-buttons/xenioo.bots.actions.base.operations.buttonurloperation)button.          |
| phone    | Defines a [Phone ](https://docs.mylinkconnect.com/actions-and-operations/cards/additional-buttons/xenioo.bots.actions.base.operations.buttonphoneoperation)button.       |
| share    | Defines a [Share ](https://docs.mylinkconnect.com/actions-and-operations/cards/additional-buttons/xenioo.bots.actions.base.operations.buttonshareoperation)button.       |

If no button type is specified Connect will display a postback button.

### Trigger

On Postback. This action will trigger any child operation as the user click any postback button.

### Variables

This action does not produce any variable.

### Availability

Channel specific availability follows the table below:

| Channel          | Availability        |
| ---------------- | ------------------- |
| Facebook         | Fully Available.    |
| WhatsApp         | **Not Available.**  |
| Telegram         | Fully Available.    |
| Web              | Fully Available.    |
| Alexa            | *Device Dependant.* |
| Google Assistant | *Device Dependant*. |
| Slack            | Fully Available.    |
| API              | Fully Available.    |

This action can be used only inside interactions and not as child of other actions. Any account can use this action regardless of [subscription level](https://docs.mylinkconnect.com/basic-concepts/your-account/the-free-plan).
