UnpackObject
Overview¶
The UnpackObject
Block extracts the properties of an object and sends them to the corresponding outputs. This is useful when you need to access individual properties of an object.
Description¶
Takes in an object and sends each key-value pair to the corresponding output
Metadata¶
- Category: Misc
Configuration Options¶
No configuration options available.
Inputs¶
Name | Data Type | Description |
---|---|---|
object | dict[str, Any] |
Outputs¶
Name | Data Type | Description |
---|---|---|
properties | dict[str, Any] |
|
properties | dict[str, dict[str, Any]] |
State Variables¶
No state variables available.
Example(s)¶
Example 1: Unpack an object into properties¶
- Create an
UnpackObject
Block. - Set the
properties
to outputname
andage
. - Provide the input object:
{"name": "John", "age": 30}
. - The Block will send
"John"
to thename
output and30
to theage
output.
Error Handling¶
- If a property in the object is not mapped to an output, it will be ignored.
FAQ¶
What happens if the object contains properties not defined in properties
?
Those properties will be ignored unless explicitly defined in the Block’s properties
.