Google sheets login issues

it gets all the data, but I can't compare the data I have

Why don't you just call back the data you need, by supplying your script (after making some changes) with the userID ?

Or you can use gviz query if your sheet is anyone with the link

If I were doing this with the Spreadsheet blocks, I would add an extra column to the sheet, containing userid/password (a triple text join.)

Then I could submit a filtered Get Row based on that column value.
I should get back 0 rows if the userID and password don't match,
one row if okay.

how can I do that?

How can I compare the data at hand with the uid data in that row

from this data:

If using the Spreadsheet component, something like this:

image

If using a gviz query (with the web component), something like this:

https://docs.google.com/spreadsheets/d/1IdpGILd7Nii8nq5yb2Qu3kVFyyL50eo5la2xbDN1Cok/gviz/tq?tqx=out:csv&tq=SELECT * WHERE D = 'lhatchard3@slashdot.org'


Login Failed
Login Success



1 Like

I can't use this component because I can't run it :frowning:

You mean the Spreadsheet component ? If to difficult for you to set up, then use a gviz query with the web component, or amend your google apps script to run the query.

Herewith an example piece of code:

// outputs results from SQL query of all data  
  else if ( fn == 'QUERY' ) {
    var rgq = sh.getName() + "!" + sh.getDataRange().getA1Notation();
    var sql = e.parameter.SQL;
    var qry = '=query(' + rgq + ';\"' + sql + '\";1)';
    var ts = ss.insertSheet();
    var setQuery = ts.getRange(1,1).setFormula(qry);
    var getResult = ts.getDataRange().getValues();
    ss.deleteSheet(ts); 
    return ContentService.createTextOutput(JSON.stringify(getResult));
  }

you need to send as parameters:

fn = QUERY
and (for example)
SQL = SELECT * WHERE B = 'name'
^^^ needs to be uriEncoded in the app before sending

yes, there seems to be a problem with this component, I tried everything, I created the structures you sent, but it always returns an error message.

I'm also trying the query you gave right away. Thank you very much.

unfortunately that didn't work either.

now i am trying a method like this; I want to verify the e-mail address and password entered by the user from google tables and send it together with the height information of the same person. All worked but I got an error retrieving the height info, why?



rtime error

Please show your raw responseContent

etablolar

So however you are getting the data is returning it as a stringified json without the header row ?

1 Like

0bea435ec9cd4306db920e6c18175e1dac3296ee_2_690x292

When you loop through a table, row by row, it helps to change the variable name 'item' to 'row', to remind you at each step climbing your mountain of logic that you are dealing with a row.

So when you are satisfied with the 4th and 6th cells in the current row, all you need is the 7th cell from that very same row.

1 Like

does it have to be this way? I think it pulled all the data

data comes like this

Thank you very much guys, I made a typo. problem solved

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.