Convert to JSON

Experimental Feature

This feature is Experimental and may change based on user feedback and testing. Share your thoughts via our chatbot to help us improve it.

The Convert to JSON (JavaScript Object Notation) building block transforms structured data formats, such as Excel, CSV, and XML, into JSON, which is commonly used for data exchange and automation workflows. This feature is available starting from Release 2025.1.

Note:

  • To use this block, cloud blocks must be activated for your tenant in the add-ons section of Customer Portal. Make sure this is enabled before adding the block to your flows.

  • The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

image-20260205-131423.png

Quick-start

  1. Drag Convert to JSON onto the canvas.

  2. Connect the block in the flow and optionally specify Source type, Select file to convert, Text fields, Default timeout, Timeout (sec).

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: The green input connector triggers the block to start executing. The green output connector in the header triggers when the file has been successfully converted. The block title (“Convert to JSON”) can be renamed by double-clicking it and typing a new title.

  • File Input: Groups the input-related settings for the file to be converted. The block supports multiple file formats as input, and file content can be provided dynamically from other blocks in the flow.

  • Source type: Defines where the input file comes from. Once a file is dropped into the block, it will automatically recognize the file type, but you can choose the source type explicitly:

    • Data File: The uploaded file is saved inside Leapwork.

    • Local Path: The file is referenced from a specified local path.

  • Select file to convert: The field where you drop the file that should be converted to JSON.

  • Text fields: Key–value fields used to insert external (dynamic) values when Local Path is selected as the Source type. To use a value, right-click the text field under the Local Path label, choose Insert token, and insert the field name. Fields can be renamed by double-clicking them, and inserted tokens update their visual representation accordingly.

  • Output: The result produced by the block after conversion, containing the JSON data. The blue output connector triggers when conversion has completed successfully and can be used as input to other building blocks.

  • Failed: Output connector that triggers if the file is not converted within the time specified in the timeout field. It can be used to branch the flow depending on whether conversion succeeded.

  • Default timeout: Controls whether the block uses the flow’s default timeout or a fixed timeout. If the checkbox is not selected, the timeout is 10 seconds. If the checkbox is selected, the Default Timeout value from the flow settings applies.

  • Timeout (sec): The maximum time spent converting the file before giving up and triggering Failed. This is separate from the case global timeout in Settings, which can cancel a run if the whole case exceeds it.

  • Download: To save the resulting file locally, use the Save file block to save the Output.

Resources

Topic

Description

Flows FAQ

Common questions about creating, running, and managing flows in Leapwork.

Flows Troubleshooting

Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.

Customer Portal Add-ons

Customer portal section to activate your cloud blocks.