# Widgets

A widget is an element of a graphical user interface (GUI) that displays information or provides a way for a user to interact with the warehouse management system.

P4W widgets combine SQL queries with visual tables and charts to provide easy access to the key information about warehouse.&#x20;

Navigate to Setup > Reporting > Widgets. From the widget list page users can access existing widgets and create new one.&#x20;

<figure><img src="/files/HLjFGUlLORdelq1pIIaR" alt=""><figcaption></figcaption></figure>

## Create New Widget

To create new widget, click 'New' button in the top right corner.

<figure><img src="/files/M6urdacKJm81tY6KHe3G" alt=""><figcaption></figcaption></figure>

In the 'New widget' pop-up window, enter name and description of the widget. Click 'Submit' to continue.

<figure><img src="/files/fFIcyQOO74O98aEGTq1D" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Notice: 'Name' field is mandatory for filling.
{% endhint %}

From the widget list page, click on the link of newly created widget to open widget details page.

<figure><img src="/files/kTQbFyTxM1SkJiiGDqCV" alt=""><figcaption></figcaption></figure>

### SQL Query

Add the new query to the corresponding field as shown below.&#x20;

<figure><img src="/files/Nl2CvH2ot585vkHO3oVO" alt=""><figcaption></figcaption></figure>

Click 'Execute' button to make sure your query is working as intended.

<figure><img src="/files/9jkjPIixNWoHSuG3A65q" alt=""><figcaption></figcaption></figure>

### Widget Visualization

To add graphical representation of data, click 'plus' button as shown below and select.

<figure><img src="/files/clh1ujXHuQR2WtO2cMem" alt=""><figcaption></figcaption></figure>

P4W widgets visualization include : Chart, Grid, and Scalar (singular number). Select the desired visual type and set them according to your needs.&#x20;

#### Chart

<figure><img src="/files/faN42Jvw4EhoDPuFOp20" alt=""><figcaption></figcaption></figure>

#### Grid

<figure><img src="/files/gKok2Aw85rVPmzhNfpj7" alt=""><figcaption></figcaption></figure>

#### Scalar

<figure><img src="/files/oKXquRkqBploetqeorfT" alt=""><figcaption></figcaption></figure>

Click 'Update' button in the top right corner to save changes.

{% hint style="info" %}
Notice: KPI's are an in-depth subject; it is recommended you speak with your P4Warehouse official reseller to get more details.
{% endhint %}

## Import Widget

To import an existing widget, click 'Import' button in the top right corner and upload a JSON file containing new widget from your local machine.

<figure><img src="/files/IzVjs9A2Oxf6pdImoMIq" alt=""><figcaption></figcaption></figure>

## Export Widget

To export an existing widget in a JSON file format, click 'Export' button from the action column next to the chosen widget.

<figure><img src="/files/PasvM2xvQ8PIxl1hixIg" alt=""><figcaption></figcaption></figure>

## Delete Widget

To delete a widget, select it with the check box mark and click 'Delete' button as shown below.

<figure><img src="/files/zKLzOU5Otf1x7oluXkdY" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Notice: contact your P4W official resellers to inquire about custom reports.&#x20;
{% endhint %}


---

# 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.p4warehouse.com/v2/reporting/widgets.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.
