I have a very simple script to check if the array contains a link. here is my code:-
var ss = SpreadsheetApp.openById('1MaxxxxxxxxxxxxxxxxxSPg');
var sheet = ss.getSheetByName('Referral Forms');
var lastrow = sheet.getLastRow();
var data = sheet.getRange("L1:L" + lastrow).getDisplayValues();
var index = data.indexOf(arr.link);
Logger.log(arr.link)
Logger.log(data)
Logger.log(" index:"+index)
My log shows value is present but its index is showing -1
.
One thing I noticed that my value contains special characters can that be the reason?
here is a snapshot of my logs:-