# kintoneのデータ取得（オンプレミス版利用の場合）

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

## 機能概要

* オンプレミス版の**kintoneのデータ取得**はkintoneからi-Reporterへ**i-Repo Gatewayを利用**して連携を行います。

<table><thead><tr><th>連携方向</th><th width="214.33333333333331">機能説明</th><th>実行タイミング</th></tr></thead><tbody><tr><td>kintone→i-Reporter連携</td><td>kintoneのデータをi-Repo Gatewayを利用してi-Reporter入力帳票のクラスターへ取得します。</td><td>i-Reporterのアクションクラスターの実行</td></tr></tbody></table>

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

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

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

* **kintoneのデータ取得**メニューをクリックして新規のマッピングを追加します。

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

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

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

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

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

<figure><img src="/files/cYwV3w14gg7slmUZut59" 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/mboqgwj6QVjPRJ07cQUg" alt=""><figcaption></figcaption></figure>

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

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

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

* マッピングできるフィールドとクラスターの組み合わせは、以下のページを参照してください。

{% content-ref url="/pages/qfBIrsfQ8yY1kAjKFqSz" %}
[kintoneとi-Reporterの連携項目対応表](/i-repo-link-manual/kintone/1/4.md)
{% endcontent-ref %}

### 6. データ検索条件の設定

* kintoneアプリのデータを抽出するための検索条件を設定します。\
  検索されたデータを元に入力帳票のクラスターにi-Repo Gateway経由で値が設定されます。
* kintoneアプリのフィールドとi-Reporter帳票定義のクラスターを指定します。
* **レコードが１件となるように検索条件を設定**してください。\
  複数レコードが検索されると自動帳票作成はエラーとなります。

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

### 7. Gatewayの設定

* i-Repo Gatewayの**アクションファイルのダウンロードまたはGatewayサーバーへアクションファイルを配置**します。\
  Gatewayサーバーへアクションファイルを配置する場合は、**事前にシステム管理のi-Repo Gateway設定**を行ってください。

{% content-ref url="/pages/j3pUvgktmFXnQz641Jhv" %}
[i-Repo Gateway設定/i-RepoLink Gateway設定](/i-repo-link-manual/system/2/3.md)
{% endcontent-ref %}

* 対象の帳票定義のアクションクラスターにGatewayのパラメーターを更新します。\
  **パラメーターの更新を行うと帳票定義のリビジョンがアップ**します。

<figure><img src="/files/9K7LWCIlb22eh3tRngV2" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
**「Gatewayへ配置」ボタンを利用するためのi-Repo GatewayのConfigファイルの設定について**

i-Repo Gatewa 2.1.230200 以降のバージョンを利用する必要があります。\
Gatewayへ配置を行うためには、i-Repo GatewayのConfigファイルの設定を変更してください。\
Configファイルをメモ帳などで開き以下の末尾に記載した **runMode** の設定を「true」に変更してください。\
なお、default.json の修正を反映させる場合は、一度i-Repo Gatewayサービスの再起動が必要となります。\
※default.json に runMode の設定の記載がない場合、以下の末尾に記載した **runMode** の設定を追加してください。

**default.jsonファイル設定**

```json
{
  "port": 3000,
  "ssl": false,
  "sslkey": "./ssl/cert.key",
  "sslcert": "./ssl/cert.pem",
  "authType": "default",
  "token": "トークン",
  "pythonShell": {
    "mode": "text",
    "encoding": "utf8",
    "pythonOptions": ["-X", "utf8"]
  },
  "uploadFileTypes": {
    "binary": "bmp;gif;jpg;tif;png;wav",
    "text": ""
  },
  "customMaster": {
    "limit": 500
  }
  ここから追加（先頭にカンマを付けてください）
  ,
    "runMode": {
    "maintenance": true
  }
  ここまで追加
}
```

{% endhint %}

[^1]:


---

# 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/kintonenodtaonpuremisuno.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.
