Skip to main content
Question

How to look up or create a column in Google Sheets


Is it possible to look up a column, or create if it doesn’t exist, similar to looking up a row?

 

When I set up a step to update a row the builder shows a pre-loaded set of columns. Not all my sheets will have these same columns. I would like to look up the column (similar to how you look up a row) and create one if it doesn’t exist.

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi ​@GregB 

That type of logic would likely involve using the GSheets API: https://developers.google.com/sheets/api/reference/rest

Options:

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7487 replies
  • January 20, 2025

Hey ​@GregB! 👋

You could use a Get Many Spreadsheet Rows (Advanced) action and set it to pull in only the first row of the spreadsheet which should contain the column names, for example:

aaa3ac1389becad77268f6c50fcf0a3a.png
 

Then you could have a filter check whether the Raw Rows field (that the Get Many Spreadsheet Rows action would output) contains a specific column name. And have a Create Spreadsheet Column (Google Sheets) action add the missing new column.

If you give that a try and run into any trouble just let us know!