# JSON / REST API Lists

The JSON data / REST answer type allows you create a list based on a remote HTTP endpoint returning JSON formatted object.&#x20;

The format of the returned JSON must an array of objects with name and value properties as shown in the short sample below.

```
  [
    {
        "name": "Alabama",
        "value": "AL"
    },
    {
        "name": "Alaska",
        "value": "AK"
    },
    {
        "name": "American Samoa",
        "value": "AS"
    },
  ]
```

{% hint style="info" %}
The name being the text displayed to the respondent in the list and the value being the actual value saved with the respondent answers.
{% endhint %}

## 🔅 JSON lists properties

* **`Type name`** display name of the list.
* **`Layout`** defines how the list will be rendered either as a dropdown list or as autocomplete field that will filter the list based on the respondent entry.
* **`JSON Data url`** http url of the endpoint returning the JSON list array eg: <http://yourrestapiserver/jsonfile.json> &#x20;
* **`Database connection string`** [connection string](https://connectionstrings.com/sql-server/) to your SQL Server database.
* **`SQL query`** Actual query that will be execute to retrieve the list items. You may also add [parameters](/form-management/form-designer/answers/answer-types/creating-new-type/lists/sql-server-lists/sql-parameters.md) to generate dynamic queries.


---

# 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://docs.ngsurvey.com/form-management/form-designer/answers/answer-types/creating-new-type/lists/json-rest-api-lists.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.
