# Create Microflow

To create **dynamic charts** in Page Designer using the Charts Extension, data must be retrieved through a **Microflow** and returned in a specific structure that the chart component can interpret.

The required Microflow output format **depends on the chart type** being used. Different chart types expect data in different structures.

***

### Microflow Data Format for Line and Bar Charts

For **Line** and **Bar** charts, the Microflow output must follow the format shown below.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FLzuHIzh6xGhYCCKycNTo%2F0?alt=media" alt=""><figcaption></figcaption></figure>

This format typically represents:

* A set of categories (X‑axis)
* One or more numeric values (Y‑axis)
* Optional grouping or series information

The chart component uses this structure to render continuous or comparative data visually across the defined axis.

***

### Microflow Data Format for Pie Charts

For **Pie Charts**, the Microflow output must follow a **different format**, as pie charts represent proportional data rather than continuous values.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F7LJw7HK9EeVN2k9ZzFVN%2F1?alt=media" alt=""><figcaption></figcaption></figure>

In this format:

* Each record represents a single slice of the pie
* Values indicate the proportion or contribution of each category
* Labels are used to identify each pie segment

This structure allows the chart component to calculate percentages and render pie slices correctly.

***

### Retrieving Data in Microflow

Users can retrieve data for the Microflow using different approaches, including:

* **Database Node**\
  To query data directly from application databases
* **WebServices Node**\
  To retrieve data from external systems or services

Once the data is retrieved and structured correctly, the Microflow can be connected to the chart component to enable **fully dynamic, data‑driven dashboards**.

***

### Summary

When building dynamic charts using Page Designer:

* Microflow is required to supply runtime data
* The output data structure must match the chart type
* Line and Bar charts use a category‑based format
* Pie charts use a proportional data format
* Data can come from databases or external services

Correct Microflow configuration ensures that charts render accurately and update dynamically at runtime.


---

# 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.onewebstack.com/oneweb-platform-th/building-apps/ui-page-designer/ux-ui-components/dashboard/dashboard-using-page-extension/create-microflow.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.
