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
- Icon: fa-th-large
- Label: unpack object, extract object properties, decompose dictionary, spread object, distribute fields
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
UnpackObjectBlock. - Set the
propertiesto outputnameandage. - Provide the input object:
{"name": "John", "age": 30}. - The Block will send
"John"to thenameoutput and30to theageoutput.
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.