> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Get basic values in FQL

FQL uses location path syntax to extract values from JSON structures. The following examples show several examples of getting basic values from JSON data.

## Example JSON

The examples below use this JSON data in a variable named `data`:

```json
{
    "name": "John Smith",
    "address": {
        "street": "123 Park Avenue",
        "city": "Atlanta",
        "state": "GA",
        "zip": "12345"
    },
    "phones": [
        {
            "type": "Home",
            "number": "123-456-7890"
        },
        {
            "type": "Cell",
            "number": "098-765-4321"
        }
    ],
    "display name": "myuser123"
}
```

## Get a top-level field

To access a top-level field with FQL, enter the field's name.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.name`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        "John Smith"
      </td>
    </tr>
  </tbody>
</table>

## Get a nested field

To access fields below the top level, use field names separated by dot `.` delimiters.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.address.city`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        "Atlanta"
      </td>
    </tr>
  </tbody>
</table>

## Get an entire object

Enter the name of an object in the JSON file to retrieve all the data within that object.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `address`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        ```json
        {
            "street": "123 Park Avenue",
            "city": "Atlanta",
            "state": "GA",
            "zip": "12345"
        }
        ```
      </td>
    </tr>
  </tbody>
</table>

## Select a specific index in an array

To access individual values in an array in a JSON file, specify an index number between square brackets after the array's name.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.phones[0].number`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        "123-456-7890"
      </td>
    </tr>
  </tbody>
</table>

## Select an entire array

Enter the name of an array in the JSON file to retrieve all the data within that array.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.phones`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        ```json
        [
            {
                "type": "Home",
                "number": "123-456-7890"
            },
            {
                "type": "Cell",
                "number": "098-765-4321"
            }
        ]
        ```
      </td>
    </tr>
  </tbody>
</table>

## Return one field of every object in an array

To return a specific field from multiple objects in an array, enter the array's name then the field's name, separated by a dot.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.phones.number`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        `["123-456-7890","098-765-4321"]`
      </td>
    </tr>
  </tbody>
</table>

## Return fields that contain special characters in the key name

If a field in the JSON file has special characters (like spaces), put the field's name in single quotes.

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.'display name'`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        myuser123
      </td>
    </tr>
  </tbody>
</table>

## Get the number of elements in a list

<table class="code-ref-table">
  <tbody>
    <tr>
      <td>
        FQL
      </td>

      <td>
        `data.$count(phones)`
      </td>
    </tr>

    <tr>
      <td>
        Result
      </td>

      <td>
        2
      </td>
    </tr>
  </tbody>
</table>