# Status Field

Status Field allows to showing of a color indicator status

You can configure this in two ways

1. Using code property in the generator
2. Using the Value property in the generator

### Using the Code property

You can set the code (path) to get the color from any property of the form context, only make sure this returns a valid color

### Using the Value property

Here you can write your custom code to return the color (or color and text) depending on some conditions, for instance, you can write the next code:

#### Return Color and Text

```javascript
let color = 'green';
let text = 'Activo';

if(context?.featureContext?.Clasificacion === 'Inactivo'){
    color = 'red';
    text = 'Inactivo';
}

const result = {color, text};

result;
```

<figure><img src="/files/mvkzJcT9kIqq1B4z5Eti" alt=""><figcaption><p>Result returning color and text</p></figcaption></figure>

#### Return only color

You can only return a string with a valid color in case you do not want to have a text alongside the indicator

```javascript
let color = 'green';

if(context?.featureContext?.Clasificacion === 'Inactivo'){
    color = 'red';
}

color;
```


---

# 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://codenull.gitbook.io/dev/configurations/components/forms/fields/status-field.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.
