Get a UserID after Login and write to Google sheets?

Hi ya ,
i'm back with another question for all you masters :slight_smile:

I want to do an little App for my own pleasure (make the work lotta easier for me and my collegue)
scanning barcodes , send them to google sheets.
This works perfect for me.

Now : as we are 2 People , catching Barcodes , i want seperate Logins for both (so i can see what BS's i scanned and what BC's he scanned)

I'vwe been watching a nice Tutorial for a login , which already works.
Is it possible to get the unique UserID (e.g 0S01) and send it to Sheets with every scan ?

Thanks in advance

where is this created ? On login/register ? If so save it to a variable when the user logs in, and then use it when you send data from the scan.

Sorry : There's no UserID created , only a login.
My thought was , to give the Logged In User and unique ID and save it as an variable........

To be honest , all the things i did so far , was created out of Tutorials , i understood , how the login works but not , how i can assign an UserID to the logged in User (a permanent , just for this user , when he logs in)

Perhaps if you share this, we can help add the UserID?

I used this :slight_smile:

Once the login is successful, store the user ID (which you can just set as the username) as a variable. When you're sending the content to Google Sheets, append that variable (which is not carrying the user ID) to said content.

See this:

ExcelWithUID.aia (3.3 KB)

Note: This is very insecure. Anyone with access to your apk can unzip it and get at the login.csv file.

1 Like

For a little app among friends, I recommend something simpler, to avoid rapid unscheduled disassembly.

Keep a TinyDB tag LOGIN, empty if not found.

At app start, check tag LOGIN, to see if user has posted a name for his device.

If no LOGIN name found, request all the names that have appeared in the online sheet, in the LOGIN column.

When the list arrives, ask the user to enter his chosen name.
If the new user name is not in the list, save it in TinyDB under tag LOGIN and use that name for the life of the app on that device.

You can't get simpler than this.

As i'm reeeeeeeealy new to AI2 , i don't know how to handle tinydb :frowning:

Get this when trying :frowning:

image

i edited the csv like username,passwort,uid

Working OK for me. Check that you have updated the csv file correctly....

username1,password1,UID01
username2,password2,UID02
username3,password3,UID03

Hmmm ,after trying 2 more times , it works.....dunno why :wink:

So , as far as i understand , the userid is know a text , am i right ?

All entries are saved to google sheets in this way (as i did...maybe dirt* code xD)

image

How can i transfer the userid (no.3) ???

Thank you very much for your help so far !!!!!

You will have to update your google form and add another entry/question for the UID, then generate the prefill form again in order to get the entry number and add this to your join block, with the UID.

Sorry for disturbing again........
Just for my understanding

This Block ;

image

will get the UserID ?

This Block ;
image

UID will be the UserID then , that i can insert to Google Sheets ?

Sorry for being "stupid" not understanding.Maybe this is a part of learning :slight_smile:

Could you please send your .aia file here?

You do not need that procedure, the UID is already set from the list generated by the csv (assuming you already have the UIDs added for each user)

Then yes, just include the variable setUID in your url to google sheets.

1 Like

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