0

I'm trying to integrate a substring method in a custom function, but I'm getting a error. My function is something simple like :

Var num = "1234567"
Var num2 = Num.slice(0,2)

I can't make it run inside a custom function that I want to use as a formula.

2
  • Custom functions have some restrictions. Commented Apr 2, 2021 at 0:58
  • Can you provide the whole script for replicating your issue? And about I can't make it run inside a custom function that I want to use as a formula., can I ask you about the detail of your current issue? Commented Apr 2, 2021 at 1:31

1 Answer 1

2

Google Apps Script /JavasScript are case sensitive.

  1. Use var instead of Var
  2. Your code declares a variable as num no Num.
Sign up to request clarification or add additional context in comments.

Comments

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.