Nodes/smn_support_nodes/[SSN] JSON Get Index Value
ComfyUI Node

[SSN] JSON Get Index Value

A node that takes a JSON-formatted string representing an array and an integer index, then outputs the value at that index in the array. Class methods ------------- INPUT_TYPES (dict): Defines the input fields for this node: - "json_string": the JSON array as a string. - "index": the zero-based index to retrieve from the array. Attributes ---------- RETURN_TYPES (`tuple`): The type of the output tuple. Here, it is a single STRING (the JSON-formatted value). RETURN_NAMES (`tuple`): The name of the output ("value"). FUNCTION (`str`): The name of the entry-point method. This node uses "execute". CATEGORY (`str`): The category under which this node appears in the UI ("JSON"). execute(json_string, index) -> tuple: Parses the JSON string as an array and returns the element at the given index as a JSON-formatted string. If parsing fails, the input is not an array, or the index is out of bounds, returns an empty string.

By SummonTheCat·Created about a year ago·Updated about a year ago· 0
[SSN] JSON Get Index Value
    • value
    json_string[]
    index0
    CategoryJSON

    Inputs (2)

    NameTypeDefaultDescription
    json_stringSTRING[]
    indexINT00–2147483647

    Outputs (1)

    NameTypeDescription
    valueSTRING