> For the complete documentation index, see [llms.txt](https://docs.nubrick.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nubrick.app/editor/variables.md).

# 変数を利用する

component editorのいくつかの箇所では、変数を利用することができます。

変数は `{{ var }}` の記法で利用でき、アプリ上で展開されます。

<figure><img src="https://704027648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FouUUZyXNgJiPZy4Uq6k8%2Fuploads%2Fgit-blob-fa45c9b2c6b63c1d51887dd7a7e2b6ccadf2e0f5%2FCleanShot%202025-08-21%20at%2017.58.40%402x.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://704027648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FouUUZyXNgJiPZy4Uq6k8%2Fuploads%2Fgit-blob-be0d967d96dfce3ff98bcb3188d6e1b6ae45de4f%2FCleanShot%202025-08-21%20at%2018.06.30%402x.png?alt=media" alt="" width="188"><figcaption></figcaption></figure>

### variables

以下の変数が利用できます。

#### user

ユーザー情報を参照できます。`setProperties` を利用してSDKで設定した任意の値を利用することができます。

* `user.id`
* `user.{key}`
  * e.g. `user.name`

ユーザープロパティの設定についてはSDKリファレンスを参照

* iOS: [NubrickSDK](/reference/ios/nubricksdk.md)
* Android: [NubrickSDK](/reference/android/nubricksdk.md)
* Flutter: [NubrickUser](/reference/flutter/nubrickuser.md)

#### props

ページに渡したpropsが参照できます。

* `props.{key}`

<figure><img src="https://704027648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FouUUZyXNgJiPZy4Uq6k8%2Fuploads%2Fgit-blob-f14ca82a95e035b5afe1472a806e726256854d22%2FCleanShot%202025-08-21%20at%2018.22.30%402x.png?alt=media" alt="" width="267"><figcaption></figcaption></figure>

#### data

ページ読み込み時に、ページ設定の「APIからデータを取得」で指定した HTTP リクエストのレスポンスを参照できます。

* `data.{key}`

<figure><img src="https://704027648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FouUUZyXNgJiPZy4Uq6k8%2Fuploads%2Fgit-blob-99556333424f02bafc0156ff119cfa886999fbaf%2FCleanShot%202025-08-21%20at%2018.25.03%402x.png?alt=media" alt="" width="274"><figcaption></figcaption></figure>

{% hint style="warning" %}
APIリクエストのHeaderやBodyなどの設定値に、APIキー・トークン・パスワード・その他個人情報などの秘匿情報を含めないでください。これらの値は公開されたエクスペリメントに平文のまま含まれ、端末上のSDKからアクセスされるため、漏洩するおそれがあります。
{% endhint %}

#### form

formの入力値が参照できます。formについての詳細は [フォームを利用する](/editor/forms.md) を参照してください。

* `form.{key}`

#### args

SDKで、Embedding ComponentやRemote ConfigのgetAsViewを呼び出す際に渡した引数を参照できます。

* `args.{key}`

#### experiment

* `experiment.id`
* `experiment.variantId`

#### project

* `project.id`

### format

`{{ var | format }}` の形式で、変数の展開時のformat形式を指定することができます。

#### letter case

英字を大文字・小文字に変換することができます

* `{{ var | upper }}`
* `{{ var | lower }}`

#### json

JSON stringifyして表示します。

* `{{ var | 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 by asking a question.

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

```
GET https://docs.nubrick.app/editor/variables.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.
