Structure node

Get by Name

Retrieve a single value from a named structure (dictionary) using its key name. Provides a direct key-based lookup without needing to decompose the entire structure.

Inputs

PortTypeDefault
StructureThe named structure or JSON object to look inside. A point or color also works — ask for x, y, z, w or r, g, b, a.structure—
NameThe key to fetch, spelled exactly as it appears in the data. An empty or unknown name gives 0 and turns Found off.string

Outputs

PortType
Valueany
Foundbool

Screenshots

Structure Family Nodes
Structure Family Nodes

How It Works

Get By Name performs a direct dictionary lookup using the provided key name. If the structure contains a matching key, the associated value is output and Found returns true. If the key does not exist in the structure, the Value output produces nothing and Found returns false.

The lookup is case-sensitive: "Temperature" and "temperature" are treated as different keys. The Name input can be driven dynamically by connecting a string from elsewhere in the graph, enabling flexible runtime lookups.

This node is designed specifically for named structures (dictionaries). If you pass an indexed structure (array), the lookup will not find any matches since arrays use numeric indices rather than string keys.

Use Cases

  • Extract a single field from a large dictionary without breaking the whole structure apart.
  • Dynamic field access by connecting a variable string to the Name input for runtime key selection.
  • JSON data extraction to pull specific fields from parsed JSON objects.
  • Configuration lookup to retrieve individual settings from a bundled configuration structure.
  • Conditional branching using the Found output to handle missing keys gracefully.

Tips

  • Key names are case-sensitive. Ensure the Name input matches the exact casing used when the structure was created.
  • The Found output is valuable for defensive programming. Use it to gate downstream processing and avoid passing empty values.
  • For positional access (by index rather than name), use the Index node instead.
  • If you need multiple values from the same dictionary, Break Named Structure may be more convenient than multiple Get By Name nodes.
  • Connect a String Compare or conditional node to the Found output for error-handling workflows.

A ready-made example project for this node is built into Grafit Pro: select the node in the library and open or drag the example from its description panel.

Open Get by Name in the interactive catalog →

Get by Name is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Structure nodes