# Simple evaluation

### Description

The `Simple evaluation` action evaluates contents or value of a variable or a field in the result stream.

Connect two actions with the output of the Simple Evaluation.

The green (success) hop will be called if the condition was evaluated successfully, the red (failure) one will be called if the condition wasn’t evaluated successfully.

### Usage

* A Null value is the same as an empty string. For example, to detect a null for any data type, set the Type to String, and the Success condition to "If value is equal to", and have the Value textbox empty.
* The Simple evaluation Action is limited. For more complex conditions see: <https://hop.apache.org/manual/latest/workflow/actions/eval.html>

### Options

| Option            | Description                                                                                                                                                                                                                                                                                                                            |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Action name       | The name of the workflow action.                                                                                                                                                                                                                                                                                                       |
| Source            |                                                                                                                                                                                                                                                                                                                                        |
| Evaluate          | Evaluation type: field or variable.                                                                                                                                                                                                                                                                                                    |
| Field name        | The field to evaluate                                                                                                                                                                                                                                                                                                                  |
| Type              | Data type.                                                                                                                                                                                                                                                                                                                             |
| Success On        |                                                                                                                                                                                                                                                                                                                                        |
| Success condition | <ul><li>If value equal to</li><li>If value different from</li><li>If value contains</li><li>If value not contains</li><li>If value starts with</li><li>If value not starts with</li><li>If value ends with</li><li>If value not ends with</li><li>If value valid regex</li><li>If value in list</li><li>If value not in list</li></ul> |
| Value             | The value to compare.                                                                                                                                                                                                                                                                                                                  |

### Tips

**Evaluating a variable**

| Field                                 | Value                | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Source: Evaluate                      | Variable             | Select this to evaluate a variable set before                                                                                                                                                                                                                                                                                                                                                                                           |
| Source: Variable name                 | e. g. ${VAR1}        | Enter the variable name using the usual syntax                                                                                                                                                                                                                                                                                                                                                                                          |
| Source: Type                          | String, Number etc.  | The type of your variable                                                                                                                                                                                                                                                                                                                                                                                                               |
| Success on: Success when variable set |                      | When this option is selected, the true path is followed when the variable is set. Note: The workflow action checks if the variable is defined, so an empty or null value is also true. When testing this within Hop you need to delete the line with the variable in the variables section of the Execute a workflow window. And remember: Once this variable is set, the variable keeps existing, even when deleting it from the list. |
| Success On: Success condition         | Equal/Non equal/etc. | Select the condition to be met for a successful result                                                                                                                                                                                                                                                                                                                                                                                  |
| Success On: Value                     |                      | Value to compare the variable to                                                                                                                                                                                                                                                                                                                                                                                                        |

**Evaluating a field**

| Field                         | Value                      | Explanation                                                                               |
| ----------------------------- | -------------------------- | ----------------------------------------------------------------------------------------- |
| Source: Evaluate              | Field from previous result | Select this to evaluate a field value (generated by a pipeline using Copy rows to result) |
| Source: Field name            |                            | Enter the field name from the result row                                                  |
| Source: Type                  | String, Number etc.        | The type of your field                                                                    |
| Success On: Success condition | Equal/Non equal/etc.       | Select the condition to be met for a successful result                                    |
| Success On: Value             |                            | Value to compare the field to                                                             |


---

# 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.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/workflows/actions/simpleeval.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.
