Hey!
I have used text input’s text as row id but the code is not working same problem I am facing with other codes too with this type of code. I need to verify if user has already registered then they can do “Sign In”. Please help me out.
I would recommend using the built-in Sign In blocks. But if you don’t want to do that, then it’s important to know that the row id value must be an integer corresponding to the row number in the data source.
Okay so is there any way I can find occurrence of my stored variable or text_input box’s value in the database? Because I have to match the value with that of in the database.
Yes, that’s what the Find First Occurrence block is for. You can use it with the List of Values data source block to return the row number where the value is found. So if your data source has these values, for example:
Apple
Orange
Lemon
Lime
And the user inputs “Orange”, then the blocks would return 2 since “Orange” is in the second row. The blocks would return 0 if the value is not found in the data source.
You can see an example of this here: Thunkable and returns a corresponding value from my sheet - #6 by tatiang
So, I have a spreadsheet as my database. How can I get the matched vakue from it because it is not a list so I am a bit confused.
Can we use stored variable as a row id?
Like in this when I am using “stored variable email” as a row id, the update does not takes place and hence the navigation also does not occur.
Get value from column in spreadsheet as list. Data Sources → list of values in
Thank you so much I got that block of get row object in database. But I am still having problem with that “stored variable” as row id. The update in the database is not taking place due to which navigation does not happen.
You cannot use an email address as a row id. The row id can only be one of two values:
- An integer (e.g. 4 for the fourth row of data).
- The green row id block inside of certain other blocks.
If you are trying to change the row that contains the user’s email, you need to use the blocks I mentioned above.
If it’s not working, be sure to post a screenshot of your blocks or a link to your project (and mention which screen has the blocks that aren’t working).
Since, in the data source, there will be many rows (whenever user sign ups a new row is created), I cannot specify a number for its row id (I am a bit confused). I have used “stored variable email” as row id because I saw in some tutorials that app variables are also used as row id. So I tried it out with stored variable.
I am having problem in the edit profile screen, the update does not take place because of row id I guess.
Here’s the project’s link: Thunkable
Handling your own sign up/sign in is a lot of work. I prefer the built-in Sign up/Sign-in blocks in Thunkable but since you’re doing it manually, you need to save the green row id value in a variable when you create a new row in a data source:
That value will point to the row where that user’s data is saved. You can then use that variable as the row id when updating a value in the data source for that user. (Ignore the “A letter, a word, or line of text.” tooltip.)
Thank you for the suggestion. But I have already “set the variables to text input box’s text”. So for row Id I have used it but the “Edit profile” is not working. The update does not take place in the data source.
@tatiang Thank you so much, you are really helping me a lot.
Also since I was asking to match the value, here’s what I had tried but this is also not working. Should I use “Get value from data source” block instead of “get first row object” block? I have to just verify whether the user who is trying to ‘Sign Up’ has already registered on my app, then I can ask them to ‘Sign In’ instead of signing up.
Yes. Get Value
is easier. If you want to use the row object, then you need to use the get property of object
block to get a specific column’s value. The blocks you currently have are comparing a text string to a row object which is not a text string so it won’t evaluate properly.
okay, Thank you. Can you please let me know about the solution for the “Edit profile” screen’s code. I have used stored variable email as row id there still it’s not working