Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Apps Script "OR" logical operator

Our "Current Tutors" sheet has a list of tutor names in column N (shown as row [13] in the code). Column A is the # of students they have (row [0]) in the code.

Basically, we want to filter our Google Form choices so that only tutors with values of 0 or 1 in column A appear. Unfortunately, it looks like the "|" does not do the logical operation of 0 OR 1. It just returns tutor names who have 0 students.

We are not savvy with coding, so any down-to-earth explanation is appreciated!

var approvedtutors = tutorNames.filter(row=>row[0]=="0"|"1").map(row => row [13])

Sheet

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In Google Apps Script / JavaScript the OR operator is || not |.

Change

var approvedtutors = tutorNames.filter(row=>row[0]=="0"|"1").map(row => row [13])

by

var approvedtutors = tutorNames.filter(row=>row[0]== "0" || row[0] == "1").map(row => row [13])

Reference

  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!