Convert-to-Object
Array Operations – Convert to Object
Summary (SEO Meta Description):
The Array Operations Convert to Object action in WeHub transforms an array into an object.
Configure a label and automatically convert arrays into key–value structures.
Overview
The Convert to Object action takes an array and turns it into an object format.
This is useful for restructuring data, simplifying lookups, or preparing payloads for APIs that expect key–value objects instead of arrays.
⚙️ Configuration Options
| Field | Type | Description | 
|---|---|---|
| Label | String | Custom name for the node (e.g., "Convert Users to Object"). | 
💡 Example Use Cases
- Convert a list of key–value pairs into a structured object.
- Transform API array responses into dictionary-style objects.
- Simplify lookup operations by using object keys instead of array indexes.
FAQ
Q: How are object keys determined?
A: Keys are derived from array item fields (platform-specific defaults apply).
Q: What happens if duplicate keys exist?
A: The last encountered value for the key will overwrite previous ones.
Q: Can I control the key selection?
A: Yes, defaults are provided, but advanced configurations may allow selecting the key field.
Keywords: WeHub Array Operations, Convert Array to Object, key-value transformation, JSON object conversion