ComfyUI > Nodes > ComfyUI-CoCoTools > JSON Value Finder

ComfyUI Node: JSON Value Finder

Class Name

JSONValueFinderNode

Category
COCO Tools/JSON Tools
Author
Conor-Collins (Account age: 431days)
Extension
ComfyUI-CoCoTools
Latest Updated
2025-03-05
Github Stars
0.03K

How to Install ComfyUI-CoCoTools

Install this extension via the ComfyUI Manager by searching for ComfyUI-CoCoTools
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-CoCoTools in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

JSON Value Finder Description

Efficiently extract specific values from JSON files using automated search and retrieval.

JSON Value Finder:

The JSONValueFinderNode is a specialized tool designed to help you efficiently locate and extract specific values from JSON files. This node is particularly useful when you need to retrieve data from a JSON file stored within a directory, based on a specific key. It simplifies the process of navigating through JSON structures by automating the search and retrieval of values, ensuring that you can focus on utilizing the data rather than manually parsing files. The node is part of the COCO Tools suite, which is tailored for handling JSON data, making it an essential component for tasks that involve JSON file manipulation and data extraction. By using this node, you can streamline your workflow, reduce errors associated with manual data handling, and ensure that you have quick access to the information you need.

JSON Value Finder Input Parameters:

json_directory

The json_directory parameter specifies the directory path where the JSON file is located. It is crucial for the node to know the exact location to search for the JSON file. This parameter must be a valid directory path, and it should contain exactly one JSON file for the node to function correctly. The node will return an error if the directory does not exist or if it contains more than one JSON file. The default value is an empty string, indicating that you need to provide a specific path.

key_to_find

The key_to_find parameter is the key within the JSON file whose value you want to extract. This parameter is essential as it directs the node to the specific piece of data you are interested in. The key should match exactly with one of the keys in the JSON structure; otherwise, the node will return an error indicating that the key was not found. The default value is an empty string, meaning you need to specify the key you are looking for.

JSON Value Finder Output Parameters:

value

The value output parameter represents the data extracted from the JSON file corresponding to the specified key. This output is crucial as it provides the actual information you are seeking from the JSON file. If the key is found, the node returns the associated value as a string. If the key is not found, the output will contain an error message indicating the issue.

JSON Value Finder Usage Tips:

  • Ensure that the directory specified in json_directory contains only one JSON file to avoid errors related to multiple files.
  • Double-check the spelling and case of the key_to_find parameter to ensure it matches exactly with the key in the JSON file.
  • Use this node in conjunction with other JSON tools in the COCO suite to build a comprehensive JSON data processing pipeline.

JSON Value Finder Common Errors and Solutions:

The provided directory path '<json_directory>' is not valid.

  • Explanation: This error occurs when the specified directory path does not exist or is not a directory.
  • Solution: Verify that the path is correct and points to an existing directory.

Expected exactly one JSON file in directory '<json_directory>', found <number>.

  • Explanation: This error indicates that the directory contains either no JSON files or more than one, which is not supported by the node.
  • Solution: Ensure that the directory contains exactly one JSON file.

Key '<key_to_find>' not found in available keys: <list_of_keys>.

  • Explanation: The specified key does not exist in the JSON file.
  • Solution: Check the JSON file to ensure the key exists and is correctly spelled.

Invalid JSON format in file '<json_file_path>'.

  • Explanation: The JSON file is not properly formatted, which prevents it from being parsed.
  • Solution: Validate and correct the JSON file format using a JSON validator tool.

Error: <error_message>

  • Explanation: A general error occurred during the execution of the node.
  • Solution: Review the error message for specific details and ensure all input parameters are correctly set.

JSON Value Finder Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CoCoTools
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.