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

120
Views
Javascript where clause for string that begins with text

Here is a sample of the Javascript, that I want to add an additional WHERE statement to the CONDITIONS variable.

In addition to Where Cost > 0, only include records where ProductName begins with "XYZ".
Maybe: AND ProductName StartsWith('XYZ') ??

  REPORTS: [{NAME: 'MYREPORTNAME',
     CONDITIONS: 'WHERE Cost > 0',
     FIELDS: {'ProductSKU' : 'STRING',
              'ProductName' : 'STRING',
              'Cost' : 'FLOAT'  
             }

This is later called in this function:

function retrieveMyReport(reportConfig, ClientId) {
  var fieldNames = Object.keys(reportConfig.FIELDS);
  var report = MyApp.report(
    'SELECT ' + fieldNames.join(',') +
    ' FROM ' + reportConfig.NAME + ' ' + reportConfig.CONDITIONS +
    ' DURING ' + CONFIG.DEFAULT_DATE_RANGE);
...

How do I expand this WHERE clause to include both conditions?

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

0

This looks like an SQL query, so you should probably use the LIKE operator:

CONDITIONS: 'WHERE Cost > 0 AND ProductName LIKE \'XYZ%\''
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!