# Connecting Data

## JSON Paths

The first step to connect data to a node is to declare the data's path in the node itself. We do it by placing the JSON path in between `${ }`. It looks something like this:

```dart
${books.chapters.titles[0]}
```

In case of the example weather app, we declare the JSON path that points to a temperature.

<figure><img src="/files/MFE6vD5uk56No38OP2oH" alt=""><figcaption><p>Dynamic Temperature</p></figcaption></figure>

Next up, providing the data to the layout in the SDK.

## Data Field

`CodelesslyWidget` takes in data using the `data` parameter which is of type `Map<String, dynamic>`. You can provide the data in the form of a JSON and the widget will be able to use its values internally.

```dart
CodelesslyWidget(
  data: const {
    'weather': {
      'temp': 20,
      'humidity': 34,
      'wind': 6,
    },
  }
);
```

Run the app. It should retrieve `temp`'s value from the data and substitute it in place of the JSON path.

<figure><img src="/files/TKYSmp0hyeKwJiGGPqbe" alt=""><figcaption><p>Dynamic data used in widget</p></figcaption></figure>

Currently, the editor supports adding dynamic data to text and image URLs.


---

# 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.codelessly.com/codelessly-cloudui/connecting-data.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.
