> For the complete documentation index, see [llms.txt](https://app.developers.karte.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://app.developers.karte.io/app-faq/app-faq-variables-large-number-items.md).

# 設定値で配信したい内容が多数ある場合に、推奨の実装方法はありますか？

設定値で配信したい内容が多数ある場合、大きく「変数を多数用意するケース」と、「変数は少量にして個々の値に json 文字列などで多数の値を格納するケース」が考えられます。

これらの実装方法について、処理上のオーバーヘッドという意味での影響度は、最終的に返却される項目数が同じであれば両者で大きな差は生じないと考えられます（ただし、JSONのサイズに応じてはJSONのパース処理で多少の負荷は生じる場合はあります）。

最終的に設定される項目数にも依存しますが、一般的な実装としては、**項目数が少ない場合は個別の変数を複数設定するパターン**、**項目数が多い場合はJSON型変数を設定するパターン**が適しています。\
下記の観点に応じてご検討ください。

### 個別の変数を複数設定するパターン

* pros:
  * native側でのJSONのパース処理が不要、個数が少ない場合はエディタ上での変数の指定がJSON型よりも容易
* cons:
  * 設定値としては変数名が重複できないため、全変数で変数名をユニーク化する必要がある
  * native側で変数を参照する際にも変数名を指定して参照する必要があるため、実装として個別に設定された変数名をすべてnative側が把握している必要がある
* その他の運用的観点:
  * 膨大な量の変数を設定する場合、エディタ上の操作で運用的な負荷がかかる（設定が煩雑になる、記入ミス等が起きやすい）可能性がある

### JSON型変数のパターン

* pros:
  * JSON型変数内での変数名については、JSONとして有効でさえあれば制約がないので、native側の実装としてはJSON型変数の変数名だけ判明しているだけで良い
* cons:
  * native側でJSONのパース処理が必要になる
* その他の運用的観点:
  * エディタはJSONを直接記述する想定で作られていないため、別途生成したJSONをコピーして設定する方法が簡便


---

# 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 dynamically by asking a question.

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

```
GET https://app.developers.karte.io/app-faq/app-faq-variables-large-number-items.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.
