Nodes/ComfyUI-ZMongo/09 ZMongo Content Pack Get JSON
ComfyUI Node

09 ZMongo Content Pack Get JSON

Pull a JSON field out of a content pack as text

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
09 ZMongo Content Pack Get JSON
  • content_pack
  • json_text
  • field_info_json
  • found
field_alias
strict_typetrue
default_value

Content packs are built from JSON, so naturally some of the fields inside them are still JSON - nested objects or arrays that a flat string node can't represent. Get JSON is the getter for those: it pulls a JSON-typed field out of a pack and returns it as serialized text, which you can pipe into any node that wants structured data as a string, or paste somewhere for inspection.

Don't be thrown by the output type. ComfyUI has no native JSON socket type, so the V3 design stores JSON-typed values and hands them back as text via this node's json_text output. You get the exact same content - just as a string you can feed into a JSON parser node, a text writer, or an LLM prompt. The json output on Get Selected behaves the same way.

The mechanics match the rest of the family. content_pack in, field_alias (with the usual alias → source path → label → numeric index fallbacks), strict_type gating the check against a stored comfy_type of JSON. default_value defaults to "{}", so a missing field degrades to an empty object instead of an error - which is the sane default for structured data, since downstream JSON parsing will at least not crash.

What to actually set

  • field_alias - the JSON field you want.
  • default_value - change it from "{}" if an empty object would silently mislead you. A sentinel value like "null" is a decent canary.
  • strict_type - on by default. When you Build a pack, nested dicts and lists classify as JSON automatically, so any object you see in the manifest should match.

Outputs

json_text (STRING) is the serialized JSON, field_info_json is the field record (its own summary is useful for a quick glance at what the nested object actually contains), and found tells you whether the lookup succeeded. No session, no network - pure in-memory read. One small trap: the serialization is pretty-printed with indentation by default, which is lovely for humans and occasionally annoying if you're feeding the string to a strict parser - keep that in mind if you see unexpected whitespace downstream.

CategoryZMongo/09 Content Packs/Get

Inputs (4)

NameTypeDefaultDescription
content_packZMONGO_CONTENT_PACK
field_aliasSTRING
strict_typeBOOLEANtrue
default_valueoptSTRING

Outputs (3)

NameTypeDescription
json_textSTRING
field_info_jsonSTRING
foundBOOLEAN