Transpose array

I have this array


and want to create a header row from it in a Google Sheet.
image
Now challenge is that I do not know the number of rows in my initial array. It is variable.
Is there any solution to that?

Welcome to the Make community!

You can add a row to your sheet, mapping each item in your header array to the columns.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

Thanks samliew. That would cater for a fixed amount of columns. However, I do not know how many rows are in my initial array. They have a structure that varies. In fact it is the result of the “keys” function on a collection.
What I was thinking is to use the Google Sheets Bulk Add Rows action and pass in the transposed array which would have one row containing all of my headers. Is there an option to convert that array into a collection (if this is the right term)?

Simply do the above for the maximum possible number of rows.