Working with custom blocks
You may create a piece of logic within a rule that you want to reuse in the current workspace or in another rule. You can create a custom block that contains the logic you want to reuse.
Custom blocks are stored as part of DataExplorer Builder's file system, which makes custom blocks portable. If you save a workspace that contains custom blocks, the custom blocks are part of the XML workspace file. When you open the file on another computer, or another user opens the file, the blocks are available in the toolbox.
Additionally, you can use one custom block inside another custom block.

You can create a custom block from existing blocks or by building new logic.
To create a custom block from existing blocks:
- Create and test the logic for the custom block in the current workspace.
- Right-click the first block that makes up the custom logic, and then select Convert To Custom Block.
- Enter a name for the custom block in Block name, and then click OK. Use a descriptive name for the block so in the future, you remember what the block does.
A custom block labeled with the name you entered in Block name replaces the first block and all of its input blocks. The custom block is saved in the toolbox in the Custom category.
To create a custom block using new logic:
If you currently have a workspace open, make sure to save any changes before creating a custom block.
- Go to File, and then select New Custom Block.
-
If the current workspace has unsaved changes, the Workspace Modified warning appears. Do one of the following:
- Click Yes to continue without saving.
- Click No to quit the operation. Save the current workspace and repeat step 1.
The workspace opens in the block editor mode. The workspace starts with a custom block block.
- Enter a name for the custom block in Custom block named. Use a descriptive name for the block so in the future, you remember what the block does.
- If you want to change the color of the custom block, click the colored square and select a color. You can give each custom block its own color.
- If you want to add a tooltip, click in the field beside tooltip and enter a tooltip. The tooltip appears when you hover over a block in the toolbox or in a workspace.
- Create the logic for the custom block. You may want to include variable inputs in the custom block.
- Evaluate the custom block.
- Go to File, and the select Save Custom Block.
The custom block is saved in the toolbox in the Custom category. The name of the custom block is the name you entered in the Custom block named field.

Once you create a custom block, you can change the logic, the name, the color, or the tooltip. If you currently have a workspace open, make sure to save any changes before editing a custom block.
To edit a custom block:
- From the toolbox or from the workspace, right-click the custom block, and then select Edit Block Definition.
-
If the current workspace has unsaved changes, the Workspace Modified warning appears. Do one of the following:
- Click Yes to continue without saving
- Click No to quit the operation. Save the current workspace and repeat the step 1.
The custom block opens in block editor mode with all of its component blocks.
- To edit the logic, add or remove blocks and evaluate the output until the custom block returns the data you expect it to. You may want to include variable inputs in the custom block.
-
To rename the block, click in the custom block named field and enter a new name. Use a descriptive name for the block so in the future, you remember what the block does.
When you save the custom block, DataExplorer Builder creates a new block with the new name. The block with the old name remains in the toolbox.
- To change the color of the block, click the colored square and select a color. You can give each custom block its own color.
- To add a tooltip to the block, click in the tooltip field and enter the tooltip. The tooltip appears when you hover over a block in the workspace editor.
- Go to File, and then select Save Custom Block.
The edits to the custom block are saved. Open a workspace to exit block editor mode.

The custom block may have been created with hard-coded inputs. To make the block more useful, you can replace the hard-coded inputs with variable inputs. When you are in block editor mode, a custom block input block is added to the Custom category. Use the custom block input block to replace the hard-coded inputs.
If you currently have a workspace open, make sure to save any changes before editing a custom block.
To add variable inputs
- From the toolbox or from the workspace, right-click the custom block, and then select Edit Block Definition.
-
If the current workspace has unsaved changes, the Workspace Modified warning appears. Do one of the following:
- Click Yes to continue without saving
- Click No to quit the operation. Save the current workspace and repeat step 1.
The custom block opens in block editor mode with all of its component blocks.
- Open the Custom category in the toolbox and add the custom block input block to the workspace.
- Replace the hard-coded input with the custom block input block.
- Enter a name in the custom block input field. It can be helpful to give it a name to help you remember the type of input it requires.
- For each input you want to replace, add another custom block input block.
- Evaluate and test the logic. Use the results to fine-tune the custom block by adding, removing, and configuring blocks.
- Go to File, and then select Save Custom Block.
The custom block is now available in the workspace and you can add an input to the custom block.

DataExplorer Builder allows you to test the logic of the entire custom block or groups of blocks within the custom block. Evaluate the logic as you build or edit the custom block to make sure each step in the logic works as expected.
To evaluate a custom block:
-
If the custom block uses custom block input blocks, connect input blocks with sample data to the test value slots of the custom block input blocks.
If you are replacing hard-coded inputs with custom block input blocks, you can use these blocks as the sample data.
-
Do one of the following:
Use the rule menu:
- Go to Rule, and select Evaluate or Evaluate to File.
- If you selected Evaluate to File:
- Navigate to the location you want to save the output.
- Enter a name for the file and click Save.
Use right-click:
-
Right-click the block where you want the evaluation to start, and then select Evaluate Here.
You can't start the evaluation from a custom block input block.
- View the result in the Output tab.
-
[Optional] To view the output in a window, double-click the last item in the Output tab.
The last message in the Output tab opens in the View Message window.
The custom block returns the result of the underlying JSON logic.
If you selected Evaluate to File, the output is also saved in a JSON file in the location you configured.

You can delete a custom block from the toolbox or from the workspace.
Use caution when deleting a custom block. If the custom block is used in the workspace and you delete it, the workspace may stop working properly. The custom block and all of its input blocks are deleted from the workspace.
To delete a custom block:
- From the toolbox or from the workspace, right-click the custom block, and then select Delete Block Definition.
- Review the Confirm Custom Block Delete warning.
- To continue deleting the custom block, click Yes.
The custom block is deleted from the toolbox, and if it was used in the current workspace, the custom block and all of its inputs are deleted from the workspace.
If the custom block is used in a saved workspace, the custom block is added back to the Custom category when you open the workspace.