cs-icon.svg

Contentstack Management - Assets Actions

Within Contentstack, all uploaded files such as images, videos, PDFs, audio files, and more are stored in your repository for later access. This repository, where uploaded files reside, is referred to as Assets. You can perform asset based operations using the following Contentstack Management Assets actions. All_Assets.png

Let’s look at each of them in detail.

Create an Asset

This action lets you create a new asset in Contentstack.

  1. Under Choose an Action tab, select the Create an Asset action.
  2. On the Create an Asset Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack from the Lookup list and enter a Title for the asset.
    3. Specify a File Name for the asset, such as ‘NewAsset.png’ or ‘NewAsset.jpeg.’
      Select_Fields.png
    4. Enter the Input URL of the image you want to create and specify a suitable Description for the asset.
      Select_Field_2.png
    5. Optionally, enable the Show Optional Fields toggle button to display the Select Folder field.
    6. In the Select Folder drop-down, choose a destination folder to store your asset.
      Show_Optional_Fields.png
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action.
    Test_Action
  5. On successful configuration, you can see the below output. Click Save and Exit.
    Contentstack_Action_Create_an_asset_Save_Exit.png

Delete an Asset

This action lets you delete an asset in Contentstack.

  1. Under Choose an Action tab, select the Delete an Asset action.
  2. On the Delete an Asset Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack and Branch from the Lookup list.
    3. In the Select Asset drop-down, select the asset you want to delete.

      If you have assets stored in nested folders within your Contentstack CMS, you can select such assets as well for deletion.

      Select_Fields.png
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action.
    Test_Action.png
  5. The output will be shown as follows. Click the Save and Exit button.
    Save_Exit.png

Get All Assets

This action lets you fetch details of all the assets in your stack.

  1. Under Choose an Action tab, select the Get All Assets action.
  2. On the Get All Assets Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack, Environment, and Branch from the Lookup list.
      Select_Fields.png

      Note: By default, the main branch is selected (even if the Branch field is empty).

    3. Optionally, enable the Show Optional Fields toggle button to display the Asset Limit, Skip Asset (Pagination) fields.
    4. In the Select Folder drop-down, select a folder to fetch the details of all the assets present in the folder.

      Additionally, you can mark the Include count, Include publish details and Include metadata checkboxes to display the count of the total number of assets, publish and metadata details in the output.

      Show_Optional.png
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action.
    Test_Action.png
  5. The output will be shown as follows. Click the Save and Exit button.
    Save_And_Exit.png

Get Asset Reference

This action lets you fetch details of all entries in which the selected asset is referenced.

  1. Under Choose an Action tab, select the Get Asset Reference action.
  2. On the Get Asset Reference Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack, Asset, and Branch from the Lookup list.
      Select_Field.png
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action.
    Test_Action.png
  5. The output will be shown as follows. Click the Save and Exit button.Save_Exit.png

Get a Single Asset

  1. Under Choose an Action tab, select the Get a Single Asset action.
  2. On the Get a Single Asset Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack, Branch, Asset, and Environment from the Lookup list.
      Select_Fields.png

      If you have assets stored in nested folders within your Contentstack CMS, you can also select those assets.

      Note: By default, the main branch is selected (even if the Branch field is empty).

      Select_Asset.png
    3. Optionally, enable the Show Optional Fields toggle button to display the Version field. Here, you can enter the asset Version to fetch the details of the asset.
      Show_Optional_Fields.png
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action.
    Test_Action.png
  5. The output will be shown as follows. Click the Save and Exit button.
    Save_Exit.png

Publish an Asset

This action lets you publish an asset automatically in your stack. To know more, visit publish assets.

  1. Under Choose an Action tab, select the Publish an Asset action.
  2. On the Publish an Asset Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack, Branch, and an Asset from the Lookup list.

      If you have assets stored in nested folders within your Contentstack CMS, you can select such assets as well for publishing.

      Select_Fields.pngYou can fetch the UID for all the previously configured automation steps directly from the Lookup list.

      Note: To dynamically fetch assets, configure the Asset Trigger and fetch the asset UID.

    3. Select the Environment(s) from the Lookup list where you want to publish the asset.
      Select_Fields.png

      Note: By default, the main branch is selected (even if the Branch field is empty).

    4. [Optional] Enable the Show Optional Fields toggle button to display the Select Locale(s) and Publish Schedule fields.
      Show_Optional_Field.png

      Note: You can select multiple Environment(s) and Locale(s) to publish the asset.

  3. Once done, click Proceed
  4. Click Test Action to test the configured action.
    Test_Action.png
  5. On successful configuration, you can see the below output. Click Save and Exit. A publish and unpublish icon will appear for the asset on the entry page.
    Save_Exit.png

Update an Asset

This action lets you update an existing asset in Contentstack.

  1. Under Choose an Action tab, select the Update an Asset action.
  2. On the Update an Asset Configure Action page, enter the details given below:
    1. Click + Add New Account button to connect your Contentstack account as shown in the Connect your Contentstack Account to Automate step.
    2. Select a Stack and an Asset from the Lookup list.

      If you have assets stored in nested folders within your Contentstack CMS, you can select such assets as well for updating their details.

      Select_Fields.png
    3. Enter a Title and a suitable Description for the asset to update.
    4. Specify a File Name for the asset, such as ‘Travel_Friendly.png’ or ‘Travel_Friendly.jpeg.’ Enter the Input URL of the image you want to update.
      Select_Field.png
    5. Optionally, enable the Show Optional Fields toggle button to display the Select Folder field.
    6. In the Select Folder drop-down, choose a destination folder to update an asset in it.
      Show_Optional_Field.png
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action.
    Test_Action
  5. On successful configuration, you can see the below output. Click Save and Exit.
    Contentstack_Action_Update_an_asset_Save_Exit.png
Was this article helpful?
^