How to replace numeric keys in Google Sheets output with column headers?

Hi everyone,

I’m using the Google Sheets > Search Rows module in Make, and when the search returns multiple rows, I pass them through an Array Aggregator. However, the resulting items have numeric keys (0, 1, 2, etc.) instead of the column header names.

I’d like each row in the array to return a proper object with the keys being the column names, not just numbers.

Is there a way to make the output include the headers as keys, or a best practice to transform the result? I tried using the header row separately, but mapping everything manually is tricky.

Any advice or examples would be appreciated!

Thanks in advance :folded_hands:

Hey there,

you can use the Aggregate to JSON module instead. This will allow you to customize the resulting array in any way you like.

2 Likes

Thanks!

I did that and it worked perfectly!
I just needed an iterator first and then I used the aggregate JSON :blush:

1 Like