question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting rows on Querying is not working

See original GitHub issue

Hi @theoephraim ,

I’am trying to get row/record on Querying with conditions. i.e. I have number of records in a google sheet with header names Emp Name, Emp ID, Emp Place etc. I’am trying to get the employee record and then, update who’s Emp ID is 6258. But its fails.

Please look in to below code snippets.

function getRecordToUpdate(empDetails, sheetInfo) {
    var options = { offset: 0 };
    options.query = 'Emp ID = '+empDetails.Employee_ID;   //here Emp ID is 6258
    return sheetInfo.getRows(options)
    .then((res) => res)
    .catch((err) => { throw err; })
}
                         (or)
function getRecordToUpdate(empDetails, sheetInfo) {
    var options = { offset: 0 };
    options.query = 'Emp ID = '+empDetails.Employee_ID;
    const response =await sheetInfo.getRows(options)
  
}

I’am getting all the records of the sheet instead of, the record with Emp ID is 6258. Please help out with this.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
theoephraimcommented, Feb 13, 2020

I don’t think it’s possible. Dig around in the google sheets docs directly.

Regardless, I suggest you try out airtable


Theo Ephraim *514.998.8436 | *theoephraim.com

1reaction
theoephraimcommented, Feb 12, 2020

No, unfortunately, that won’t help. Google discontinued their row-based api which included the querying abilities. I recreated the row-based calls as best I could, but it can’t do everything it used to. I recommend you try out https://airtable.com/invite/r/UnvfbjVY instead of google sheets.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql - Query works but cant retrieve the data - Stack Overflow
I have two issues: I do not know how to get the queried data into an object and; If I run the script...
Read more >
List rows present in a table - Filter Query not working
Solved: Hi All, My excel sheet has 5000 rows, I need to filter the row for specific values in particular column using filter...
Read more >
Power Query Not Loading All Rows
Solved: I have tried to see if anyone else has had this issue but can't find anything. I have a query (using Power...
Read more >
Querying for data - The Go Programming Language
QueryRow itself returns no error. Instead, Scan reports any error from the combined lookup and scan. It returns sql.ErrNoRows when the query finds...
Read more >
Troubleshooting in Athena - AWS Documentation
CREATE TABLE AS SELECT (CTAS)Data file issuesFederated queriesJSON related ... For more information, see When I query CSV data in Athena, I get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found