Reputation: 831
I rearranged some columns and now my code isn't working. I'm trying to use vlookup to get values from another table.
var name = ss.getRange('G'+lastRow);
name.setValue('=VLOOKUP("Form Responses_Images/"&B'+lastRow+',importrange("https://docs.google.com/spreadsheets/d/###","Form Responses!Q:AA"),8,false)');
SpreadsheetApp.flush();
name.copyTo(name,{contentsOnly:true});
The table that I need to fill in:
The table that I am using to look up info:
Right now when I run the script, the cell just freaks out and gives the error: Error Did not find value 'Form Responses_Images/20ba4a5c.Upload.040416.jpg' in VLOOKUP evaluation.
But as you can see both tables have the value Form Responses_Images/20ba4a5c.Upload.040416.jpg
in it?
Upvotes: 0
Views: 186
Reputation: 27350
You need to fix the importrange
function and the column index. Start from column V
and get the 3
rd column after that.
Replace:
name.setValue('=VLOOKUP("Form Responses_Images/"&B'+lastRow+',importrange("https://docs.google.com/spreadsheets/d/###","Form Responses!Q:AA"),8,false)');
with:
name.setValue('=VLOOKUP("Form Responses_Images/"&B'+lastRow+',importrange("https://docs.google.com/spreadsheets/d/###","Form Responses!V:AA"),3,false)');
Upvotes: 1