The Pentaho Javascript step seems to be executing multiple times beyond its intended frequency

In my Pentaho workflow, I have a Modified Javascript Value step where I included the following code to calculate the number of words in a string and output it to a file:

var str = "How are you doing today?";
var res1 = str.split(" ").length;

To provide input to this step, I used a Generate Rows step with a dummy variable. However, when checking the output, instead of seeing the expected result of 5 once, it is printed multiple times as shown below:

tmp_dummy;res1
;5
;5
;5
;5
;5
;5
;5
;5
;5
;5
;5

The variable tmp_dummy was defined in the 'Generate Rows' step. Can anyone explain why the output '5' is repeated so many times? This process was done using Kettle Spoon.

Answer №1

It appears that you have configured the Limit parameter to be 10 in the Generate Rows stage. If you only require one row, adjust it to 1.

As it is currently set to 10, the process will run 10 times and produce 10 rows as you mentioned.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the correct way to write a for loop in Angular/JavaScript to initialize a form?

I am working on a form and I am trying to create a loop based on the size of my matches array: pronoPlayer0:['',Validators.required] pronoPlayer1:['',Validators.required] pronoPlayer2:['',Validators.required] I am unsure o ...

Why using document ready is ineffective for handling kendo controls

Feel free to test out the code snippet below: <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://cdn.kendostatic.com/2014.2.1008/js/kendo.all.min.js"></script> <script type="text/javascript"& ...

What makes `Why await` stand out from all the other broken promises?

I am puzzled by the behavior of promises in Node.js and I have a question about it. Let's take a look at the following function as an example: async function proc(): Promise<void> { const resolve = new Promise((resolve) => setTimeout(resolv ...

Tips for receiving a post response following a 500 internal server error in AngularJS

I am encountering a 500 Internal Server Error when I try to make a post service call. Despite having an interceptor set up to open a dialog, the dialog appears empty. The error seems to be preventing me from receiving the response of this call, but I can v ...

Types of flow. What sets apart type {} from {||}?

I am unsure of the specific distinctions. I am curious about the variations. ...

Utilizing Rails' remote: true feature to prevent the webpage from refreshing

Currently, I have a 'projects/show.html.erb' page where a project has many 'project_messages'. Users can successfully create new project messages on this page. However, there is an issue where the page refreshes when creating a new proj ...

An issue arises in React TypeScript where a callback function is encountering undefined values when using setState, but surprisingly logs the

Struggling with a React application I'm building, specifically with an issue that's got me stumped. Here's a snippet of code that's causing trouble: onFirstNameChange(event: any){ console.log(event.target.value) // this.setState ...

What is the best way to extract function bodies from a string with JavaScript?

I am currently searching for a solution to extract the body of a function declaration by its name from a JavaScript code string within a Node.js environment. Let's assume we have a file named spaghetti.js that can be read into a string. const allJs = ...

Storing data using angular-file-upload

In my application, I am utilizing the "angular-file-upload" library to save a file. Here is the code snippet that I am using: $scope.submitForm = function(valid, commit, file) { file.upload = Upload.upload({ url: '/tmp', data ...

Encountered a 500 error while trying to save data in MongoDB

Currently, I am in the process of building a Vue application using Mongo and Express. Unfortunately, I have encountered a bug after sending a post request to Mongo. Uncaught (in promise) Error: Request failed with status code 500 at createError (createErr ...

The jquery fancybox ajax modal popup fails to display in Internet Explorer 7

Recently, I utilized JQuery fancy box for the first time to display a menu list. When clicking on a specific item, the page is rendered properly in an iframe. However, if there is already an AJAX model popup present on the rendered page, it doesn't di ...

In the world of GramJS, Connection is designed to be a class, not just another instance

When attempting to initialize a connection to Telegram using the GramJS library in my service, I encountered an error: [2024-04-19 15:10:02] (node:11888) UnhandledPromiseRejectionWarning: Error: Connection should be a class not an instance at new Teleg ...

Creating a PDF document using html2pdf: A step-by-step guide

Currently, I am immersed in a project using React. The main goal right now is to dynamically generate a PDF file (invoice) and then securely upload it to Google Drive. In the snippet of code provided below, you can see how I attempted to create the PDF f ...

Javascript alert function for confirming background color

Options are displayed in blue, and using JavaScript, I check if the background color is blue. If it's not, execute the next step; otherwise, display an alert message. function click_option_A() { var clr_1_chk = document.getElementById("1"); //alert ...

Echoing JavaScript within a heredoc in PHP

I'm having trouble echoing JavaScript from PHP within a heredoc. I've tried escaping the dollar sign, but it's still not working. Can anyone provide assistance with this issue? Thank you. Error: Uncaught ReferenceError - $ is not defined ...

What's the best way to display alert messages using the alert method in Node.js with Jade?

Is there a way to render a 'Jade view' with data? For example, in the following code: app.get('/', function(req, res){ res.render('alert', {msg: 'hi!'}); }); I attempted to write the Jade code below: (alert.ja ...

ObjectArray in Node.js

Building an object array in my node app involves transforming another object array. Let's assume the initial object array is structured like this... levels: [ { country_id: 356, country_name: "aaa", level0: "bbbb", level1: "cccc", level2: "dddd", le ...

What is the best way to save the properties of elements in an array of objects within another array?

I have obtained attributes from objects within an array that I need to store in another array. Here is the data I am working with: https://i.sstatic.net/b0JtY.jpg My goal is to extract the `displays` name attribute and save it in the `opt[]` array, which ...

How to locate the data-id of the next element in a jQuery list

Is it possible to retrieve the data-id of the following list element when clicking a button while on the current active list item? <div class="nbrs"> <ul> <li id="item1" data-id="1" class="active ...

Error: Namespace declaration does not have a type annotation - TypeScript/Babel

After creating my app using the command npx create-react-app --typescript, I encountered an issue with generated code and namespaces causing Babel to throw an error. Here are the steps I took to try and resolve the issue: I ejected the project Updated b ...