Can you create a struct with a dynamic key in pipeline builder?

Hi! I am trying to use pipeline builder to construct an API payload. The problem is this payload includes a struct with a {key: value} pair where the key is dynamic per row. I tried using format string but the problem is nesting it into the overall struct payload then wraps the struct in quotes which makes the API read it incorrectly. Is there any way to use a dynamic key in pipeline builder?

Hey, would constructing a Map type work for your use case? Structs are meant to have predefined fields with concrete field names, while maps are meant to have dynamic keys.

1 Like

Yes! looks like that works for me, I just had to add additional columns to store the map keys/values as single value arrays to get them to work with the create map operation.

1 Like