# 自動帳票作成

<div align="left"><figure><img src="/files/ejBZZeDrq5sOKCU38C1E" alt=""><figcaption></figcaption></figure></div>

## 機能概要

* **自動帳票作成**は、kintoneからi-Reporterへの連携を行います。

| 連携方向                 | 機能説明                                   | 実行タイミング                                        |
| -------------------- | -------------------------------------- | ---------------------------------------------- |
| kintone→i-Reporter連携 | kintoneのデータを元にしてi-Reporterの帳票を自動作成します。 | kntoneアプリのレコード編集画面のボタンクリック(i-Repo Link連携プラグイン) |

{% hint style="success" %}
i-Repo Linkのバージョンが1.0.251204以降の場合、ゲストスペースでもkintoneプラグインをご利用いただけます。
{% endhint %}

## マッピング設定の手順

以下の手順に従ってマッピング設定を行ってください。

### 1. kintoneとの連携パターンの選択

* **自動帳票作成**メニューをクリックして新規のマッピングを追加します。

<figure><img src="/files/HBPKDFhfMNxDtaDNP9qx" alt=""><figcaption></figcaption></figure>

### 2. マッピングコード・名称の設定

* **マッピングコード**と**マッピング名称**を設定します。
* マッピングコードは、**i-Repo Link環境内の全てのマッピング設定を一意に識別するキー**になります。

<figure><img src="/files/Szprw48m7IMSCrVmct9s" alt=""><figcaption></figcaption></figure>

### 3. 連携元のkintoneアプリの選択

* kintoneの**データソース**と**kintoneアプリ**を選択します。

<figure><img src="/files/QD7Yuz8wa5wmITJqBVQX" alt=""><figcaption></figcaption></figure>

* データソースの追加・設定は、以下のページを参照してください。

{% content-ref url="/pages/Mr8iIh9WBLvgsGDHpX6I" %}
[データソース管理](/i-repo-link-manual/system/2/1.md)
{% endcontent-ref %}

### 4. 連携先のi-Reporter帳票定義の選択

<figure><img src="/files/wb6eXOP1eJcG5DNvYOKW" alt=""><figcaption></figcaption></figure>

### 5. kintoneアプリとi-Reporter帳票定義のクラスターをマッピング

* 画面左側にkintoneアプリ情報、画面右側にi-Reporterの帳票定義情報が表示されます。
* kintoneアプリのフィールドが薄いグレーのものは、連携対象外のフィールドです。
* マッピングできない場合は、エラーメッセージが表示されます。

<figure><img src="/files/lRuM1cqUmOxMXt9jbNzt" alt=""><figcaption></figcaption></figure>

### 6. マッピング操作

* **kintoneアプリのフィールド**と**i-Reporter帳票のクラスター**をマッピングします。

<figure><img src="/files/y0M0wOHTpleKatBDefhW" alt=""><figcaption></figcaption></figure>

### 7. トークンの設定

* 連携先の**kintoneアプリのAPIトークン**を設定します。
* kintoneへ連携時に使用されます。

<figure><img src="/files/HoTRVTj1BUQZh9ZLvtcN" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
kintoneのAPIトークンのアクセス権が不足している場合、kintoneへの接続に失敗します。\
レコード閲覧、レコード追加、レコード編集の権限は付与するようにしてください。
{% endhint %}

### 8. Webhook URLの設定

#### **kintone設定用Webhook URL**

* **kintone設定用Webhook URL**は、**i-Repo Link連携kintoneプラグイン**に設定します。
* kintoneからi-Repo LinkへのWebhook通知に使用するURLが表示されます。\
  i-Repo Linkを経由してi-Reporterの自動帳票作成などを実現します。
* i-Repo Link連携kintoneプラグインの設定は、以下のページを参照してください。

{% content-ref url="/pages/NVgAxOdH3zWYoaeDRvqr" %}
[i-Repo Link連携kintoneプラグインの設定](/i-repo-link-manual/kintone/1/2.md)
{% endcontent-ref %}

<figure><img src="/files/oJWUty9ebVjcB8ZA0lbP" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cimtops.gitbook.io/i-repo-link-manual/kintone/2/2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
