> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.getPath

> Membaca nested value dari table memakai dotted string path atau array table of keys.

<div className="real-function-page">
  ```lua theme={null}
  json.getPath(object: table, path: string | table, defaultValue?: any): any | nil
  ```

  ## Alias

  * `json.getpath`

  ## Argumen

  <ParamField path={"object"} type={"table"} required>
    Root table yang dibaca. Function mewajibkan argument ini berupa table.
  </ParamField>

  <ParamField path={"path"} type={"string | table"} required>
    Path yang diikuti. string di-split pada dots; integer string tokens dibaca dengan raw array indexing. table path memakai array entries dari 1 sampai #path sebagai keys.
  </ParamField>

  <ParamField path={"defaultValue"} type={"any"}>
    Fallback value yang dikembalikan saat traversal mencapai nil atau non-table sebelum path selesai.
  </ParamField>

  ## Return

  <ResponseField name={"pathValue"} type={"any | nil"}>
    Value pada requested path. Jika path hilang, mengembalikan defaultValue bila disediakan, jika tidak nil.
  </ResponseField>

  ## Contoh

  Baca nested table value dari dotted string path atau array table of keys.

  ```lua theme={null}
  local document = {
      user = {
          profile = { name = "Guest" },
          items = { "first", "second" },
      },
  }

  local name = json.getPath(document, { "user", "profile", "name" }, "Unknown")
  local second = json.getPath(document, "user.items.2")

  print(name)
  print(second)
  ```
</div>
