> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/experience-cloud/experience-cloud-ja/chtoriaru/components/data-table/displaying-salesforce-cms-files-in-a-data-table.md).

# Salesforce CMSファイルをデータテーブルに表示する

## 概要

このチュートリアルでは、以下の使用方法を順を追って説明します [Avonni **データテーブル**](https://docs.avonnicomponents.com/experience-cloud/experience-cloud-ja/chtoriaru/components/data-table.md) コンポーネントを使用して、次の場所からファイルの一覧を表示します **Salesforce コンテンツ管理システム（CMS）コレクション**。テーブルを設定し、各ファイルに「ダウンロード」ボタンを追加して、特に Experience Cloud サイト内でユーザーにシームレスな体験を提供する方法を学びます。

**学習内容：**

* Avonni データテーブルを Salesforce CMS コレクションに接続する方法。
* Title や Created Date などのコンテンツ詳細を表示する列を設定する方法。
* 「ダウンロード」ボタン付きのカスタムアクション列を追加する方法。
* 次の使用方法： **Download CMS** インタラクションを使って、ユーザーがファイルをダウンロードできるようにする方法。

**前提条件：**

* 有効な **Salesforce CMS コレクション** が必要です。公開済みのコンテンツ項目が 1 件以上含まれている必要があります（例：PDF、画像）。
* 必要になるのは **18 文字の ID** この CMS コレクションの

***

## 手順付きガイド

{% stepper %}
{% step %}

### Data Table コンポーネントを追加する

まず、CMS ファイルの一覧を表示するデータテーブルを設定しましょう。

1. 次の **コンポーネントライブラリ** （左パネル）で、次のものを見つけて **Avonni Data Table** コンポーネントをキャンバスにドラッグします。

<figure><img src="https://9391847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDL6JQuZArjJeQvX2ot4y%2Fuploads%2Fgit-blob-d10d63ca89ac9593ad245d5dd8efefd33eb92526%2F2025-06-11_10-59-29.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### データソースの設定

次に、データテーブルを特定の Salesforce CMS コレクションに接続する必要があります。

1. データテーブルを選択した状態で、 **データソース** プロパティパネルでプロパティを見つけます。
2. 選択し **CMS Collection** データソースタイプの一覧から選択します。
3. の **コレクション ID** 表示された **18 文字の ID** フィールドに、Salesforce CMS コレクションまたは Content Key の

を入力します。データテーブルはこれで接続され、コレクション内のコンテンツ項目を認識できるようになります。

<figure><img src="https://9391847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDL6JQuZArjJeQvX2ot4y%2Fuploads%2Fgit-blob-d853f2001b5586a9552e5a1a0acf197ff68b5a4e%2F2025-06-11_10-49-59.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### コンテンツ情報を表示する列を追加する

では、ファイルに関するどの詳細をテーブルに表示するかを定義しましょう。

1. データテーブルのプロパティで、 **カラム** セクションに移動します。
2. クリック **「列を追加」** を選択して新しい列を作成します。
3. **ソースフィールド：** CMS コンテンツデータからフィールドを選択します（例： `タイトル`).
4. **列ラベル：** ユーザーにわかりやすいラベルを付けます（例：「ドキュメント名」）。
5. この手順を繰り返して、次のような他の関連列も追加します `CreatedDate` または `LastModifiedDate`.

<figure><img src="https://9391847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDL6JQuZArjJeQvX2ot4y%2Fuploads%2Fgit-blob-1f973fb2ed7668d4524f10786aca282280fbc0f6%2F2025-06-11_10-49-59.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### ダウンロードアクションを追加して設定する

これは、ファイルをユーザーに利用可能にするための最も重要な手順です。ファイル名に直接リンクすることはできないため、専用のアクションボタンを作成します。

1. **アクション列を追加：** の **カラム** セクションで、データテーブルのプロパティの **「列を追加」** をもう一度クリックします。列の設定で、その **タイプ** を **ボタン**.
2. **ボタン項目の設定：**
   * ボタン列のプロパティ内で、新しいボタン項目を追加します。
   * 次のような **ラベル** ラベルを付けます。「ダウンロード」や「ファイルを表示」など。
   * 次のように設定します **アイコン名** （例： `utility:download`）とすると、視覚的な手がかりがよりわかりやすくなります。
3. **「Download CMS」インタラクションを作成する：**
   * 先ほど設定した「ダウンロード」アクション項目を選択します。
   * その **インタラクション** セクションに移動して、 **クリック時** インタラクションを追加します。
   * その **タイプ**で、 **Download CMS**.
   * この特定のインタラクションは、テーブル内のその特定の行に関連付けられた CMS ファイルを安全に生成してダウンロードを開始するように設計されています。このインタラクションに他のプロパティは必要ありません。

<figure><img src="https://9391847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDL6JQuZArjJeQvX2ot4y%2Fuploads%2Fgit-blob-38b333ff71c3d8f17816c9073cb522db11961a9f%2F2025-06-11_10-52-06.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 保存してデプロイ

これで Avonni データテーブルが Experience Cloud ページ上で直接完全に設定されたので、最後の手順はサイト訪問者に公開することです。Experience Builder では、設定の変更は通常、作業中に保存されますが、 **公開** して、サイトをオーディエンスに表示されるようにする必要があります。
{% endstep %}
{% endstepper %}

## 専用の「Download CMS」インタラクションを使う理由

コンテンツが Salesforce CMS で管理され、Experience Cloud サイトに表示される場合、ファイルには単純なリンクで移動できる標準の「レコード詳細ページ」がありません。テーブル内のファイル名は単なるテキストです。 **Download CMS** インタラクションは安全な橋渡しとして機能し、行に関連付けられたファイルのバージョンを正しく識別して、ユーザーのダウンロードを開始します。これにより、信頼性が高くシームレスなユーザー体験が確保されます。

## **結果**

これで、Salesforce CMS コンテンツを一覧表示する動的で使いやすいテーブルが完成しました。ユーザーがどの行の「ダウンロード」ボタンをクリックしても、対応するファイルがデバイスに直接ダウンロードされます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/experience-cloud/experience-cloud-ja/chtoriaru/components/data-table/displaying-salesforce-cms-files-in-a-data-table.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
