Skip to content
Advertisement

How do I get a column value from multiple sheets

I have a working script to create a Google Doc from a Google Form, but I want to change one of my values to sheet2. I am using sheet2 to =CLEAN a column due to line breaks I can’t get rid of in column 3 on sheet1. I replicated my script for a simple form/doc below to test. I want var title to pull values from column 5 on sheet 2 instead of column 3 on sheet 1. Or perhaps there is a better way to solve my formatting issues of line breaks remaining in my created Doc from template?

JavaScript

Advertisement

Answer

Based on what you’ve provided, one small change is needed. Instead of

JavaScript

Just add in a replace to remove all nonprintable text like so

JavaScript

Below is the full code with the edit. Good luck!

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement