
Previewing and fixing errors as they appear
Now that you have completed the design of the Transformation, let's run some previews:
- Select the UDJE step and run a preview. You already know how to do it: click on the Preview icon in the Transformation toolbar and then click on Quick Launch. You'll see the following screenshot:

Errors while previewing a Transformation
Something is wrong. A pop-up window tells us that there are no rows to preview, but we can also see that an error has occurred. We know that because:
- The background of the Calculator row in the Step Metrics tab changed to red (highlighted)
- The border of the Calculator step also became red (highlighted)
- If you click on the Logging tab, you will see the error explained, also in red (highlighted) text
All of these indicators tell us which step caused the error. In this case, it was Calculator.
By reading the log, we can see the source of the error. In the file, we have an invalid value (???) in a place where a Date is expected. Let's retry the preview, but this time on the Calculator step:
- Click on the Calculator step and run a preview. This time a popup with results appears, but we only see two rows:

Partial Preview of a Transformation
Again, we have the same error. How do we fix this? For now, we will bypass the error by deleting in the file the row that is causing the error. Don't worry! Very soon we will learn to deal with it and put that line back in the file.
- Edit the projects.txt file and remove the row that is causing the error.
- Click on the Calculator step and run the preview one more time. This time, you will see all the rows and a new column with the new field diff_dates:

Preview of a Transformation
- Close the window and click on the UDJE step. Run a new preview. You will see this:

null values in a Preview
Clearly, this is not what we expected. Instead of a text with duration and performance, we only see null values. There are no visible errors, but if you click on the Logging tab, you will find out the problem: Among all the lines in red containing the full description of the error, you will find this:
Row Preview - duration None : Unknown type 0 specified.
This error is telling you that you didn't specify the type for the field duration.
At the beginning, it may be tricky to understand some error messages, but it's just a matter of time to get familiar with them.
- Edit the UDJE step. Under the Value Type column, select String for both the duration and message fields. Close the window.
- Make sure the UDJE step is selected, and run a final preview. The error should have disappeared from the Logging tab, and the window should display the final data:

Final preview of a Transformation
There is something important to note about the preview functionality you experimented with in this section.
When you select a step for previewing, the objective is to preview the data as it comes out from that step. The whole Transformation is executed unless you disable a part of it. Don't feel intimidated if you don't understand completely how the used steps work. Right now, the objective is not to fully dominate PDI steps, but to understand how to interact with Spoon. There will be more opportunities throughout the book to learn about the use of the steps in detail.