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