# Select Values

The Select Values step can perform all the following actions on fields in the PDI stream:

* Select fields
* Remove fields
* Rename fields
* Change data types
* Set length and precision

### General

* **Step name**: Specify the unique name of the Select Values step on the canvas. You can customize the name or leave it as the default.

### Select & Alter tab

Use this tab to select fields, optionally rename them, and set length and precision.

| Column        | Description                                                   |
| ------------- | ------------------------------------------------------------- |
| **Fieldname** | Name of the field from the input stream.                      |
| **Rename to** | New name of the field. Leave blank to keep the original name. |
| **Length**    | Field length.                                                 |
| **Precision** | Number of floating point digits for number fields.            |

* Select **Get fields to select** to add all fields from the input stream.
* Select **Edit mapping** to open the Edit Mapping dialog.
* Select **Include unspecified fields, ordered by name** to include any input fields that are not explicitly listed.

### Edit Mapping dialog

Use the Edit Mapping dialog box to define multiple mappings between source and target fields.

{% hint style="info" %}
Edit Mapping supports only one target output step.
{% endhint %}

| Option                           | Description                                                             |
| -------------------------------- | ----------------------------------------------------------------------- |
| **Source fields**                | Incoming fields available to map.                                       |
| **Target fields**                | Target fields/columns available to map.                                 |
| **Add**                          | Adds the selected source/target combination to **Mappings**.            |
| **Delete**                       | Removes a mapping and returns the fields to the selection lists.        |
| **Mappings**                     | The resulting source-to-target mappings.                                |
| **Auto target selection?**       | Select to map to a target automatically.                                |
| **Hide assigned source fields?** | Select to hide source fields after they are mapped.                     |
| **Auto source selection**        | Select to automatically select a source field when you select a target. |
| **Hide assigned target fields?** | Select to hide target fields after they are mapped.                     |
| **Guess**                        | Automatically matches fields and populates **Mappings**.                |

### Remove tab

Use this tab to remove fields from the input stream.

* Select **Get fields to remove** to populate the list with incoming fields.

{% hint style="info" %}
Removing fields can slow processing because internal field order changes.
{% endhint %}

### Meta-data tab

Use this tab to rename fields, convert data types, and set length/precision.

{% hint style="warning" %}
If you renamed a field on the **Select & Alter** tab, the name you use in **Fieldname** on the **Meta-data** tab must match the renamed value.
{% endhint %}

| Column                        | Description                                                                                                                             |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Fieldname**                 | Name of the incoming field (or the renamed value from **Select & Alter**).                                                              |
| **Rename to**                 | New name of the field. Leave blank to keep the current name.                                                                            |
| **Type**                      | Data type for the field.                                                                                                                |
| **Length**                    | Field length.                                                                                                                           |
| **Precision**                 | Number of floating point digits for number fields.                                                                                      |
| **Binary to normal?**         | Set to `Y` or `N` to convert a string to a numeric data type when appropriate.                                                          |
| **Format**                    | Format mask. See [Common Formats](/pdia-data-integration/pdi-transformation-steps-reference-overview/common-formats.md).                |
| **Date format lenient?**      | Set to `N` to accept only strictly valid date values. Set to `Y` to attempt to correct invalid dates when possible.                     |
| **Date locale**               | Locale for date conversions. Leave blank to use the system default.                                                                     |
| **Date time zone**            | Time zone for date conversions. Leave blank to use the system default.                                                                  |
| **Lenient number conversion** | Set to `Y` to parse numbers until a non-numeric character is encountered (no error). Set to `N` to report an error for invalid numbers. |
| **Encoding**                  | Text encoding. Leave blank to use the system default.                                                                                   |
| **Decimal**                   | Decimal point character (`.` or `,`).                                                                                                   |
| **Grouping**                  | Thousands separator character (`.` or `,`).                                                                                             |
| **Currency**                  | Currency symbol.                                                                                                                        |

Select **Get fields to change** to import fields from previous steps.

For more information, see [Understanding PDI data types and field metadata](/pdia-data-integration/understanding-pdi-data-types-and-field-metadata.md).

### Examples

The `design-tools/data-integration/samples/transformations` directory contains the following example transformations:

* `Select values - some variants.ktr`
* `Select Values - copy field values to new fields.ktr`

### Metadata injection support

All fields of this step support metadata injection. You can use this step with [ETL metadata injection](/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection.md) to pass metadata to your transformation at runtime.


---

# 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.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/select-values.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.
