All Collections
Supporting Information
Testing and Debugging
4. How to validate JavaScript code in the Calculator step
4. How to validate JavaScript code in the Calculator step

Validating the JSON code in the Calculator step or the Calculator steps in the flow.

Praise Magidi avatar
Written by Praise Magidi
Updated over a week ago

1. Validate Button in the Calculator step

The Calculator Step has a Validate button that can be used to validate the JavaScript code in the step. The validation errors will be listed and displayed on the step itself as shown in the example below after clicking on the Validate button.

If the code is valid, a message will be displayed as shown in the image below.

2. Validate button in the Flow Builder

The Validate button in the flow builder can validate if the code in a Calculator step will give an error when you process a run. This feature assists when debugging a flow before testing or executing it.

Illustrated in the image below is the Validate option which is located next to the Flow Details option when a flow is open.

In this example, x=1 and y=2 is added in a Calculator step in the flow as shown in the image below.

Click on Validate and a red warning sign will appear on the Calculator step which will give an error due to the code that was inputted. Highlighted in the below page are the Validate button and the warning error sign on the Calculator step.

Click on the warning sign on the Calculator step and the Validation Errors tab will open as shown in the below image. This tab will contain the error of the inputted code. In this example, it shows that the fields (x and y) were not declared in the Calculator step which is why it was not defined.

Did this answer your question?