# Low-code configuration

The configuration definition is available in the module **Application** Eximee Designer.

{% hint style="info" %}
Applications that use the configuration server to fetch configuration must have configured [Data model](/documentation/documentation-en/budowanie-aplikacji/model-danych.md) and a start point set.
{% endhint %}

When going to a given application window, the left panel contains the tab **Configuration,** and in the right window **Configuration Editor**:

<figure><img src="/files/c1f6b9157c86511f04db026cb78a83cd55c19279" alt=""><figcaption><p><em><strong>Figure 1.</strong> Configuration from Eximee Designer - Configuration tab</em></p></figcaption></figure>

## Configuration format <a href="#konfiguracjazpoziomulowcode-formatkonfiguracji" id="konfiguracjazpoziomulowcode-formatkonfiguracji"></a>

Configurations are defined in the format: key = value

### Environment setup <a href="#konfiguracjazpoziomulowcode-ustaleniesrodowiska" id="konfiguracjazpoziomulowcode-ustaleniesrodowiska"></a>

Additionally, it is possible to specify the environment for which a given setting will be available by adding a suffix to the key **|${environment\_key}** e.g.

application.logi&#x6E;**|prod**=keyValue

Such a setting will by default be available only for the environment marked as "prod".

We can define the environment using the ENV - **CONFIG\_SERVER\_ENVIRONMENT\_NAME** in the configuration server application.

If there is no suffix key for the current environment, values without a specified suffix are used.

### Comments <a href="#konfiguracjazpoziomulowcode-komentarze" id="konfiguracjazpoziomulowcode-komentarze"></a>

In the configuration editing window, it is possible to add comments in the configuration content. Comments should start on a **new line**, and the comment content should be preceded by the **hash symbol (#)**.

### **Definition of roles authorized to edit in Eximee Dashboard** <a href="#konfiguracjazpoziomulowcode-definicjaroluprawniajacychdoedycjiweximeedashboard" id="konfiguracjazpoziomulowcode-definicjaroluprawniajacychdoedycjiweximeedashboard"></a>

{% hint style="warning" %}
Please note that in addition to defining roles in Eximee Designer that are authorized to edit a specific configuration in Eximee Dashboard, the Eximee Dashboard user must have assigned a role with permission **feature\_config\_edit**, which gives access to the "Application Configuration" tab.
{% endhint %}

Together with the configuration in Eximee Designer, you can define roles that will allow editing the configuration [runtime](/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/konfiguracja-aplikacji-biznesowej-serwer-konfiguracji/modyfikacja-runtime-konfiguracji-biznesowych.md) in Eximee Dashboard. If no roles are defined in the application configuration in Eximee Designer, editing the application configuration from Eximee Dashboard will not be available to any user.

Role definitions can be specified in the "Roles authorized to edit in Eximee Dashboard" field above the configuration editor in Eximee Designer.

If the configuration server application has the AUTH\_ROLE\_STRIP\_PREFIX parameter defined, then the given role prefix should be omitted from the list items.\
So if AUTH\_ROLE\_STRIP\_PREFIX = "PDC000000001-" and the role is named "PDC000000001-config-editor-role", then in the list in Eximee Designer you should specify "config-editor-role".

\
Editing configuration in Eximee Dashboard: [Modification (runtime) of business configurations](/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/konfiguracja-aplikacji-biznesowej-serwer-konfiguracji/modyfikacja-runtime-konfiguracji-biznesowych.md)

<figure><img src="/files/7c1016fc810c5d4db1938868403bf4ad7c317863" alt=""><figcaption><p><em><strong>Figure 2.</strong> Configuration from Eximee Dashboard - "Application Configuration" tab</em></p></figcaption></figure>

### Configuration example <a href="#konfiguracjazpoziomulowcode-przykladkonfiguracji" id="konfiguracjazpoziomulowcode-przykladkonfiguracji"></a>

CONFIG\_SERVER\_ENVIRONMENT\_NAME = **dev**

Configuration content:

```editorconfig
#url links to test environment
test.url|dev=urlDev
test.url=urlDefault
 
test.password=passwordBasic
test.password|prod=passwordProd
test.password|dev=passwordDev
 
 
test.login|prod=loginProd
test.login=loginDefault
 
 
test.enabled=true
```

The config server for such settings will return 4 configurations (without suffix):

```editorconfig
test.url=urlDev
 
test.password=passwordDev
 
test.login=loginDefault
 
test.enabled=true
```

### **Configuration editing** <a href="#konfiguracjazpoziomulowcode-edycjakonfiguracji" id="konfiguracjazpoziomulowcode-edycjakonfiguracji"></a>

Editing the configuration locks the application artifact, therefore new artifacts cannot be added to it, e.g. a process, form. However, an attempt to add such an artifact **will create it in the repository**, but **it will not be attached** to the application artifact.<br>

In the case of syntax errors in the configuration (e.g. invalid unicode was provided for a configuration of type PROPERTIES), an error will occur when saving the configuration, which will have the general form of errors occurring when saving an artifact:

<figure><img src="/files/86da6e2ce2dc9202abc4684e9bd43c4d1224ff8d" alt=""><figcaption><p><em><strong>Figure 3.</strong> Error while saving an invalid application configuration</em></p></figcaption></figure>

The user will remain in editing mode and will be able to correct any syntax errors and try saving the configuration again.

### Using configuration values in ScriptCode <a href="#konfiguracjazpoziomulowcode-uzyciewartoscizkonfiguracjiwscriptcode" id="konfiguracjazpoziomulowcode-uzyciewartoscizkonfiguracjiwscriptcode"></a>

In ScriptCode, we can retrieve a value from the configuration using the configuration retrieval API:\
\
API:

```typescript
interface Api {
    config: {
        v1: {
          get(key: string): string;
          getOrDefault(key: string, defaultValue: string): string;
        }
    }
}

```

example script using the API:

```javascript
function callService(context) {
    let value1
    try {
        value1 = api.config.v1.get("dummy.url2");
    } catch(e) {
        value1 = "default"
    }
  
    var value2 = api.config.v1.get("dummy.url");
  
    var value3 = api.config.v1.getOrDefault("not_existing_key", "defaultValue")
  
    return [{'value1': value1, 'value2': value2, 'value3': value3}];
}

```

{% hint style="info" %}
\*The API also works for script calls in the data model.
{% endhint %}

The editor also offers suggestions:

<figure><img src="/files/e5a9b45e52a01b6298faebc82a53f23753a5e5f1" alt=""><figcaption><p><em><strong>Figure 4.</strong> Example of a suggestion while typing code</em></p></figcaption></figure>

#### Using configuration values in a script task <a href="#konfiguracjazpoziomulowcode-uzyciewartoscizkonfiguracjiwzadaniuskryptowym-przykladowezadanieskrytowe" id="konfiguracjazpoziomulowcode-uzyciewartoscizkonfiguracjiwzadaniuskryptowym-przykladowezadanieskrytowe"></a>

Example script task:

```javascript
function handle(task, context) {
    // Retrieve variables from the configuration
    const skipTask = api.config.v1.get("script.task.skip.task")
    const titleName = api.config.v1.getOrDefault("script.task.title.name", "Default title")
     
    // Finish the task and pass variables (skipTask, titleName) to the process
    context.complete({'skipTask': skipTask, 'titleName': titleName});
}
```

use in the process:

<figure><img src="/files/68fb4dd61e5819894f7e5dfca9f412863109c28c" alt=""><figcaption><p><em><strong>Figure 5.</strong> Example of using configuration values in a process</em></p></figcaption></figure>

As a result, the values from the configuration will be passed to the process and saved under the keys: skipTask and titleName.

{% hint style="info" %}
Business configuration in Eximee: [Business Application Configuration](https://eximee.com/business-application-configuration/)
{% 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.eximee.com/documentation/documentation-en/zarzadzanie-aplikacja-biznesowa/zarzadzanie-konfiguracja/konfiguracja-aplikacji-biznesowej-serwer-konfiguracji/konfiguracja-z-poziomu-low-code.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.
