google-sheetsgoogle-apps-scriptgoogle-sheets-formula

NAME error hiperlink function Apps Script Google Sheets


i am getting a strange error, #NAME? error while inserting formula into cell.

Heres the code:

var email = empresa[0][4];
var linkEmail = "mailto:"+email;
view.getRange("F6").setFormula('=hiperlink("'+linkEmail+'")'); // Email

i have tried with different approaches, but the same results, dont know if its a String error or something else, but i just copy and paste the content of cell into another cell and it work.

error: enter image description here

same content, working: enter image description here

i just want to create a mailto hyperlink with a existing list of clients.

enter image description here


Solution

  • There is a typo in your formula. It should be hyperlink instead of hiperlink.