# 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.
FQL data.name
Result "John Smith"
## Get a nested field To access fields below the top level, use field names separated by dot `.` delimiters.
FQL data.address.city
Result "Atlanta"
## Get an entire object Enter the name of an object in the JSON file to retrieve all the data within that object.
FQL address
Result ```json { "street": "123 Park Avenue", "city": "Atlanta", "state": "GA", "zip": "12345" } ```
## 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.
FQL data.phones[0].number
Result "123-456-7890"
## Select an entire array Enter the name of an array in the JSON file to retrieve all the data within that array.
FQL data.phones
Result ```json [ { "type": "Home", "number": "123-456-7890" }, { "type": "Cell", "number": "098-765-4321" } ] ```
## 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.
FQL data.phones.number
Result \["123-456-7890","098-765-4321"]
## 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.
FQL data.'display name'
Result myuser123
## Get the number of elements in a list
FQL data.$count(phones)
Result 2