# Problem with insert in a spreedsheet

**URL:** https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982
**Category:** Questions about Thunkable X
**Tags:** beginner, spreadsheets
**Created:** [November 23, 2022, 6:32pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982 "2022-11-23T18:32:41Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 23, 2022, 6:32pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/1 "2022-11-23T18:32:41Z")

</div>

Hello,  
i have a google spreedsheet (Docenti) with one sheet (inAttesa).  
inAttesa has this columns: Email,Password,Nome,Cognome,OTP.  
I need to verify if an email is already inside inAttesa, if there is i only write a message “Email already used”.  
On the contrary, i have to insert the record inside inAttesa with OTP field empty

 ![problem](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/5/a58a72124149e73189744794e6ab9d638d4a4723.png)

I don’t understand why it doesn’t work

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 23, 2022, 6:32pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/2 "2022-11-23T18:32:58Z")

</div>

Could you help me please?  
Thanks in advance

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 23, 2022, 10:14pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/3 "2022-11-23T22:14:50Z")

</div>

> [@anastasi.fr6w](#):
>
> I don’t understand why it doesn’t work

Which part does work and which part does not work? What are you seeing that indicates that it isn’t working?

You should be aware that there has for a long time been a [bug](https://github.com/thunkable/thunkable-issues/issues/1138) with the `get value` data source block. If possible, try using the `get row object` block instead. You can test your code by inserting a block right before the `if` block that shows the result of the `get value` block in a label and adding a short wait time after it. That way, as your loop runs, you can watch the values to see if they are the same as in your data source.

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 24, 2022, 8:24am UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/4 "2022-11-24T08:24:18Z")

</div>

First if…it works.  
Second if, it doesn’t work.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 24, 2022, 1:57pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/5 "2022-11-24T13:57:19Z")

</div>

So it does not create a row in the data source?

What happens if you add a block above the create row block that changes the value of a label’s text? Does that get displayed?

You’ll need to do some troubleshooting like this. I have a method I use: [Debugging in Thunkable X (Video)](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471)

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 24, 2022, 2:48pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/6 "2022-11-24T14:48:31Z")

</div>

This works.  
When i click the button a row is inserted without problem.

 ![it works_1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1c88205f9879eeb472d24cba1a8f3217809267d4.png)

* * *

It also works. I tried a debugging system printing some variables. Everything is ok here.

 ![it works_2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a8c838d825debbaf35417a9f0232c999a7ecc217.png)

Now i will try to stop the loop, exit and look for a warning variable printing it.  
It doesn’t work

 ![it doesnt works_1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5bb309931eca249d0e2a7de965175ac12442f2a7.png)  
I don’t read “Out of the loop”.

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 24, 2022, 3:14pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/7 "2022-11-24T15:14:47Z")

</div>

Maybe i found the possibile situation of error:

 ![solution](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/e/eea049d30a0b939851b2fd7733f434b32566e604.png)  
looking at “numers of rows in Docenti inAttesa” i print 27(WHY??). Inside the sheets there are only 3 rows.  
Could be this the problem?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 24, 2022, 4:28pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/8 "2022-11-24T16:28:03Z")

</div>

Are there blank rows at the end of the data source? That happened to me recently with Google Sheets.

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 24, 2022, 5:06pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/9 "2022-11-24T17:06:59Z")

</div>

This is how sheet appears:

 ![sheet](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1c2890a5bf774142aaf598efbc0b42bbe557be5f.png)

27???

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 24, 2022, 5:12pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/10 "2022-11-24T17:12:00Z")

</div>

Try syncing the sheet from the Data Sources section in the Design tab. After you do that, drag in a **new** list of values block.

It should be retuning 8, not 27.

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 25, 2022, 2:35pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/11 "2022-11-25T14:35:11Z")

</div>

After deleting the sheet Docenti, reuploading the same file, syncing and changing all the block it continues to print 27.  
It is really strange!

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 25, 2022, 2:42pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/12 "2022-11-25T14:42:19Z")

</div>

Update:  
If you are able to guess what this print you are a genius.

 ![New Stranger thing](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/a/8aeb4ea5f5ea198ab11cce78e17a362d965c29c5.png)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 25, 2022, 5:11pm UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/13 "2022-11-25T17:11:15Z")

</div>

27?

If you’d like, you can share the spreadsheet with me and I’ll try the same thing and see what happens. I know that’s not very useful but it could identify a bug if it happens to me too.

---

<div class="post-metadata">

### Author: ![anastasi.fr6w](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@anastasi.fr6w](https://community.thunkable.com/u/anastasi.fr6w)
#### Post date: [November 26, 2022, 8:37am UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/14 "2022-11-26T08:37:19Z")

</div>

it appears: UNDEFINED! incredible…  
ok, give me your email please so i can share the spreedsheet

Thank you.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 26, 2022, 9:01am UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/15 "2022-11-26T09:01:48Z")

</div>

I’d prefer you to send a share link as a private message on the forums. I don’t usually give out my email address.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [February 24, 2023, 9:01am UTC](https://community.thunkable.com/t/problem-with-insert-in-a-spreedsheet/2145982/16 "2023-02-24T09:01:57Z")

</div>

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