# Response Key Selector

Setelah request berhasil (GET) secara default saba framework akan mencari kunci "<mark style="color:purple;">data</mark>" pada respons data dari server seperti ini:

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

Respons dari backend terdiri dari 3 objek, dan dalam objek data terdapat array yang akan di transform ke sebuah tampilan, contohnya tabel.

Kenyataannya tidak semua respons dari backend seperti contoh diatas, tergantung spesifikasi dari pengembang aplikasi backend itu sendiri. Namun kamu tetap bisa menyesuaikannya dengan mengkonfigurasi pada properti <mark style="color:purple;">**resp\_key**</mark> seperti contoh dibawah ini:

***

### <mark style="color:blue;">Contoh 1</mark>

Response data dari <https://raw.githubusercontent.com/lakuapik/jadwalsholatorg/master/adzan/bandung/2023/12.json>

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

Perhatikan bahwa data yang di respons dari backend tidak memiliki objek induknya. Baris data berupa array langsung di respon tanpa ada key lain seperti contoh sebelumnya diatas. Maka kamu dapat menyesuakainnya seperti ini:

```json
{
  "pageType": "crud",
  "pageTitle": "Jadwal Adzan",
  "crudOpt": {
    "detailFromGrid": true,
    "endpointName": "https://raw.githubusercontent.com/lakuapik/jadwalsholatorg/master/adzan/bandung/2023/12.json",
    "resp_key": "",
    "removeDefaultHttpHeader": true
  }
}
```

Maka hasil pada UI akan tampil seperti ini:

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

***

### <mark style="color:blue;">Contoh 2</mark>

Response data dari <https://api-berita-indonesia.vercel.app/tempo/nasional> seperti ini:

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

Perhatikan bahwa baris data berupa array yang akan kita tampilkan di halaman berada pada objek anak <mark style="color:purple;">posts</mark> yang memiliki induk <mark style="color:purple;">data</mark>, kamu dapat menyesuaikannya seperti ini:

```json
{
  "pageType": "crud",
  "pageTitle": "Berita",
  "crudOpt": {
    "detailFromGrid": true,
    "endpointName": "https://api-berita-indonesia.vercel.app/tempo/nasional",
    "resp_key": "data.posts",
    "removeDefaultHttpHeader": true
  }
}
```

Maka hasil pada UI akan tampil seperti ini:

<figure><img src="/files/7ikf559cLBM0Vw6Xkus9" 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://saba-framework.gitbook.io/saba-framework-documentation/customization/response-key-selector.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.
