Property Getter
Extracts a value from an object using a dot-separated path.
This node extracts a value from a complex object (like a dictionary or list) using a dot-separated path. It's useful for accessing specific data from parsed files (e.g., from a Parser node) or other structured data.
Property Path Syntax#
The path is a string that specifies the location of the desired value.
- Nested Objects: Use a dot (
.) to access properties within an object. - Array Elements: Use an integer index in brackets (
[n]) to access an element in an array.
Example#
Given an object like this:
{
"project": {
"name": "Project X",
"assets": [
{ "name": "character.fbx", "type": "model" },
{ "name": "texture.png", "type": "texture" }
]
}
}
You can use the following paths to extract data:
| Path | Result |
|---|---|
project.name |
"Project X" |
project.assets[0] |
The first asset object |
project.assets[0].name |
"character.fbx" |
project.assets[1].type |
"texture" |
If the path is invalid or the property does not exist, the Error execution path is triggered, and the found output is false.
Inputs#
| Port | Description |
|---|---|
| The object to extract the value from. | |
| The dot-separated path to the desired property. |
Outputs#
| Port | Description |
|---|---|
| Executes if the property is found. | |
| Executes if the property is not found or the path is invalid. | |
| The extracted value. | |
| True if the property was found, false otherwise. |
ID: core/property-getter@v1