Pass data to the second screen

Hi Guys,

I’m trying to develop login app using spreadsheet as the login information. I managed to handle the login form process and successfully to do the screen changing (second screen called Screen_main).

Now I’m stuck to pass the login information the second screen. I’m not really sure what’s the reason. Actually, first time I hit the login button, it shows warning that the data (list length is 0). But when I try to hit it again it pass through the second screen (some times I have to hit the button more than 2 times).

I don’t know how to troubleshoot this since I don’t know how to log the output list (i.e. for google app script we can log the data).

here is my design view

And here is my block
initialize


web2gottext

here is the spreadsheet data
ss

Here is the apk
Rojak.apk (5.7 MB)

Thanks

Use ‘Open another screen with start value’ block to send data to another screen. :slight_smile:

You can use tiny db to store user info in local storage this will improve apps performance

1 Like

Yes. I use that block. But the problem is that when I tried to get the data in screen 1 the first try will always return data with 0 length.
Here is the error:

Then I tried for the second time, it went successfully to second screen. So I can’t figure out why is the data didn’t return on the first try.

Replace web component by spreadsheet component
See the documentation about spreadsheet, how to know it works
https://docs.kodular.io/components/storage/spreadsheet/

1 Like

The reason why I’m not using tinydb is I want the data all centralized in my spreadsheet. In the future, I don’t want to modify my apps, just modify the spreadsheet.

You can save username and pass in tinydb and get data in another screen I am not saying to store whole data in tinydb just the user who is logged in just add his data to tinydb to pass to another screen and get data …

I’'ll try to play around. Thanks

To get data from spreadsheet you need used spreadsheet component not web component !!!

I got your point. I’ll try. But is there any difference using variables to send data to second screen.

Yes variable may occur prblm some time but if you will use tiny db and give the data separate storage you can get data at any screen

1 Like

The Spreadsheet component has everything you need to obtain data and work with it. Why do you use the web component?

The error you get is because you get an empty list. Check that all airtable cells are full. If you have empty cells with Airtable you will not get any data.

Then with the spreadsheet component you get the columns that have the registration data. Then you compare that the data entered by the user is within the list obtained from each column. If they are, you open another window, if they are not you put a notification.

You could consider the idea of making a user system with Firebase. Their free plan allows you to do 10,000 verifications per month.

It is more secure and you do not manage user passwords. In firebase you can’t see their passwords. In Airtable instead you can see the password they have used to log in. Taking into consideration that people use more or less the same password, storing passwords without any kind of encryption is not safe for the person using your app…

Do you know why it’s happening?
It’s because trying to get value from the list but ‘global loginData’ is not a list. Change the data type to list.

the same error message is showing here also:

1 Like

No, he is not trying to get a list data type from ‘global loginData’ varible, this is irrelevnt.

@halim

if your problem is exchanging data between screens, you can try to build your screens using HV-arrangement instead, it will save you a ton of work in debugging errors.

Actually, it’s not about sending data between screen. I tried to figure out the data on the first screen,
listuser --> ok.
listAllData --> empty on the first button click, but if I hit for the second times, the data is there.

Here is my second attempt. The data is shown up (listAllData)

if you updated your blocks, please post it here.

Here is the update. Not much progress. Still trying to understand. Maybe my fundamental is not strong enough.

And this is the result