# Modified JavaScript Value

{% hint style="warning" %}
**Workshop - Modified JavaScript value**

The Modified Java Script Expression step in Pentaho Data Integration (PDI) allows users to execute custom JavaScript code to transform and manipulate data within a transformation. This step provides a powerful scripting environment where you can write JavaScript functions to perform complex calculations, data validations, string manipulations, and conditional logic that might be difficult or impossible to achieve with standard PDI steps.

The step takes input fields from the data stream, processes them through your custom JavaScript code, and outputs the results as new fields or modified existing fields. It's particularly useful for implementing business rules, data cleansing operations, or complex transformations that require programming logic beyond what built-in PDI steps can provide.
{% endhint %}

<figure><img src="/files/2nq74ynmw49wSqFPy6pT" alt=""><figcaption><p>Modified JavaScript Value</p></figcaption></figure>

***

{% tabs %}
{% tab title="First Tab" %}

{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="1. Generate rows " %}
{% hint style="info" %}
**Generate rows**

The Generate Rows step in Pentaho Data Integration (PDI) is a data generation component that creates synthetic data rows based on user-defined specifications. This step allows you to generate test data, sample datasets, or placeholder records by defining field names, data types, and value ranges or patterns.

You can specify how many rows to generate and configure various parameters like random number ranges, date intervals, or fixed values for each field. It's particularly useful for testing transformations, creating mock data for development purposes, or generating large datasets for performance testing without requiring an external data source.
{% endhint %}

<figure><img src="/files/otp3qRt51O2ria5y27QI" alt=""><figcaption><p>Generate rows</p></figcaption></figure>
{% endtab %}

{% tab title="2. Modified JavaScript Value" %}
{% hint style="info" %}
**Modified JavaScript value**

The Modified JavaScript value step provides a user interface for building JavaScript expressions that you can use to modify your data. The code you type in the script area is executed once for each input row.

* The transform allows multiple scripts in a single transform instance.
* The JavaScript step is not an input step and therefore requires an input stream from the pipeline.
  {% endhint %}

<figure><img src="/files/FvbadoZI3vu98GbYQVka" alt=""><figcaption><p>Modified JavaScript value</p></figcaption></figure>

{% hint style="info" %}
Here the name of the var = name of output data stream field. In some cases you will need to 'escape' the character.
{% endhint %}
{% endtab %}
{% endtabs %}


---

# 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://academy.pentaho.com/pentaho-data-integration/data-integration/enrich-data/scripting/modified-javascript-value.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.
