How to create multiple new columns

Hello,

I am currently trying to figure out how to insert multiple new columns as headers (number of which is unknown) into my sheet. I am experimenting with reading the data and then editing it but I cant figure out how.

I am open to different solutions tho

UPDATE:
I found this post Add new header/ column name in a blank google worksheet

but when I try it I get error

Update your Code node to wrap the list of headers inside another array, making it 2D:

const data = $input.first().json.data;
const headers = data.split(',').map(h => h.trim());
return [{ json: { values: [headers] } }];

Then in your HTTP Request node update the bodyParameters section to:

"name": values,
"value": {{ $json.values }}

No need to include “range” inside the body — it’s already set in the URL. Your current config redundantly sends it twice.

Remove Define Headers node as you’re already handling everything in the Code node properly and passing values correctly to the HTTP request