0

I have this function which works in Google Sheets, but when I put it in Google script it does not work and says I am missing a ).

=ArrayFormula(split(concatenate(filter('Copy of LeaveCache_LVE'!$G$3:$G, 'Copy of LeaveCache_LVE'!$A$3:$A=A3)),"))"))

This is what I put in Google script:

cell.setValue('=ArrayFormula(split(concatenate(filter('Copy of LeaveCache_LVE'!$G$3:$G, 'Copy of LeaveCache_LVE'!$A$3:$A=A3)),"))"))');
1
  • Look at the quote marks you are using. (Hint: the formatter here is showing the same issue that Apps Script is detecting). Commented Apr 8, 2019 at 13:01

2 Answers 2

2

I have found a solution that keeps the Built In Functions as follows:

This was the original that do NOT work:

cell.setValue('=ArrayFormula(split(concatenate(filter('Copy of LeaveCache_LVE'!$G$3:$G, 'Copy of LeaveCache_LVE'!$A$3:$A=A3)),"))"))');

//////////////////////////////////////////////////////////////////////////////

This is the solution that DID work:

cell.setValue('=ArrayFormula(split(concatenate(filter(\'Copy of LeaveCache_LVE\'!$G$3:$G, \'Copy of LeaveCache_LVE\'!$A$3:$A=A3)),"))"))');

What I found that worked was inserting a \ (backslash) before the ' (single quotation)

Hope this helps someone else too!

Sign up to request clarification or add additional context in comments.

Comments

0

Or you can try to use the cell.setFormula method.

2 Comments

The issue with the post is that nested quotation marks were not escaped, so the value itself was not properly constructed. Changing the function that uses the value will not alter the problem with the value construction.
Okay, thanks for help. I misunderstood the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.