Skip to main content
5. Debug a Calculator code error

Debugging errors introduced in the Calculator step configuration

Praise Magidi avatar
Written by Praise Magidi
Updated over 7 months ago

In any Synatic process, there may be a need for custom calculations and code. For example, the Calculator step in Synatic lets you add custom Javascript code to a Flow.

In this article, we will use the Calculator step, introduce a deliberate error, and then see the Synatic response and how we resolve it.

The flow below shows a data source from a Record Generator and then read in the JSON format. There is a Calculator step which can execute some code on the data or execute a calculation.

The image below shows the data in the Record Generator Step. The id is "2" and the Name is "Homer".

A "false" error is forced into the calculator JavaScript code, as shown in the image below.

Once this is this is done, click the blue play button in the Calculator step (shown in the image below) to test that step in the flow.

This page below will be displayed which will allow you to test the step.

The Break on Record Error option is selected by default. This causes the run to process the dataset and stop immediately on the first error encountered.

Click on the expander arrows ษ… to view more information on the error details as highlighted in the image above.

If the Break on Record Error option is selected and the test is re-run, the test will run the process through the dataset and collate all errors in the Log Record Error step.

For more information on log records, please click on the link below.

Additional information:

Did this answer your question?