# Progress Bar

{% hint style="info" %}
*<mark style="color:blue;">**Content under construction**</mark>*
{% endhint %}

The Progress Bar component shows a progress bar that can be used to indicate the progress of lengthy processes.

Example:

![Progress Bar](/files/8fEcpoMfgWLXBFcC9Px8)

## Table of contents

* [Progress Bar properties](#progress-bar-properties)
* [Progress Bar API](#progress-bar-api)

## Progress Bar properties

Progress Bar properties can be found [here](/reference/servoyextensions/ui-components/visualization/progress-bar.md#properties)

## Progress Bar API

Progress Bar API methods can be found [here](/reference/servoyextensions/ui-components/visualization/progress-bar.md#api)

### [setProgress](/reference/servoyextensions/ui-components/visualization/progress-bar.md#setprogress)

Updates the progress, optionally setting the given value text

### [updateProgressBar](/reference/servoyextensions/ui-components/visualization/progress-bar.md#updateprogressbar)

To update the progress bar you should update the value of the progress bar.

`elements.myProgressBar.value = 60;`

Please note that runtime changes to element's properties are not pushed immediately to the UI. To reduce the number of the round-trip server to client, Servoy keep track of the runtime changes and push them to the client as soon the method thread is terminated or as soon an updateUI is forced. An updateUI can be explicitly invoked with application.updateUI().

The function below updates the progress bar only once the execution is terminated.

```javascript
function onAction(event) {
 // UI is updated only when the the loop is over; there is 1 round-trip server to client
 for (var index = 0; index <= 100; index++) {
   elements.bs_progressbar.value = index;
   application.sleep(50);
 }
}
```

This function behave differently then the function above, updating the progress bar at each iteration.

```javascript
function onAction(event) {
 // UI is updated at each iteration. There are 100 round-trip to server to client
 for (var index = 0; index <= 100; index++) {
   elements.bs_progressbar.value = index;
   application.updateUI();
   application.sleep(50);
 }
}
```


---

# 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.servoy.com/guides/develop/application-design/ui-components/visualization/progress-bar.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.
