This is the query code I'm using to get form responses filtered to pull only a specific user ID from a google form in one Google Sheets workbook into another workbook:
=QUERY(IMPORTRANGE("KEYID#","Form Responses!Col1:A"), "SELECT * WHERE 'Col12'=222")
The sheet has 12 columns, A:L. Rows keep getting added as new submissions are made.
I want to pull only row entries with the user ID 222. User IDs are located in Row E/Column 5. 222 is a number, not a string.
The query above returns a Value error:
"Error: Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: col12"
Without using IMPORTRANGE in the same workbook as the form database, I am able to query this using:
=QUERY('Form Responses'!A1:ABT,"where E=222")
Having two separate workbooks as intended, and I don't have the [select - where]
statement,
=QUERY(IMPORTRANGE("KEYID#","Form Responses!COL1:A"))
spits out the entire form database.
Any ideas?
Best Answer
The syntax of your first formula is wrong.
Form Responses!COL1:A
is not a valid reference. Hard to know what you are trying to do here. NOTES:A1:B1
,A1:B
,A:B
or1:1
whereA
andB
could be any column name while the first is the same column or it be always at the left of the second, also1
could be any row number while the first is the same or it's on top the second.COL1:A
as reference is converted toA1:COL
whereCOL
is the 26th column of the sheet.'column(12)'
is not the proper way to reference a column in the select argument of QUERY. UseCol12
instead without apostrophes/single quote marks.