# Scan QR Code Issue - Repeating the action 4/5 times

**URL:** https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899
**Category:** Issues / Bugs
**Created:** [November 5, 2024, 11:24am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899 "2024-11-05T11:24:37Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 5, 2024, 11:24am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/1 "2024-11-05T11:24:37Z")

</div>

Hello everyone,  
I have an app based on a QR Code scan - it used to work perfectly but know that i’m working on it again for a couple of updates, i realised it has now a couple of problems qcode-related  
It was working just fine until i tried it again on Thunkable app

Here the relevant blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/b/2bd62aa78db97cb4e09a2f44de8f7b72bd107818.png)  
In these blocks the camera scans the QRCODE and receives a value. If this values is = to another, it continues to “Scrivi Orario” - and here is where the problems lays

Here the “Scrivi Orario” function:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/4/8498bea972058966864aac5bbd1b9f34046a6d5f.png)

Everything was working fine, and still is working fine on the app in the stores, it writes values into an Airtable table once.  
This is what it’s supposed to do:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/24e2dbc78d9b0b3ec605e0f81abd37dbe1236d45.png)

Now what is happening is that the app is writing 4 to 5 times all together.  
This is what is happening at the moment:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/f/df7935f05c3cab7c95e03a873080765753cfddd0.png)

Anyone faced a similar issue or know how to solve it?  
I run out of ideas and the update is really important - i’m not confident on uploading an app with this issue as many clients are using it atm.

Thank you very much for your help

---

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 5, 2024, 1:28pm UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/2 "2024-11-05T13:28:45Z")

</div>

I’d like to add that i’m using the latest Thunkable version on app and my Android device is updated to its latest version

---

<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 5, 2024, 7:15pm UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/3 "2024-11-05T19:15:52Z")

</div>

What’s missing from your screenshot is the event block. What is above those blocks? Is it a When button click event? What happens if you add a counting variable to the “then do” section and display its value when the function is done? Does it count up 4 to 5 times?

Having a full screenshot of those blocks without anything cut off would be helpful.

---

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 5, 2024, 10:19pm UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/4 "2024-11-05T22:19:39Z")

</div>

Thank you @tatiang for your time.  
Above the API call is an not relevant block that just triggers in a couple of events that are not linked to this function - i tried already to cut them off and just keep the API call and it gives the same result

Here is the full block - in this case the variable “LocaleScannato” is “WikiWoo”, so no one of the one above

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/b/eb37cca829103fc647bb16cf5617c8a372ecdf78.png)

I also would like to mention that there is a different block after the API call, that includes a List block, and also that one is repeated three to five times

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/b/3b5b3652d42a06f2d9b5e8d471e885928a053f29.png)

This means that in the List “ListaDipendenteOrari” it inserts the text 3 to 5 times.

Here are the relevant complete blocks - sorry i had to take more pictures are they are very long:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/f/6f30998c74515f8a0b3adb6123f64b089112ac92.png)

I also tried to change the “LocaleScannato” variable to another one but it still does this action 3 to 5 times instead of only one.

---

<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 6, 2024, 2:26am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/5 "2024-11-06T02:26:51Z")

</div>

What happens if you remove ALL blocks from ScriviOrario and just put a Change App Variable by 1 block there and display the value of that variable? I’m trying to determine if that function is getting called multiple times somewhere else in your project.

---

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 6, 2024, 7:56am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/6 "2024-11-06T07:56:21Z")

</div>

Hello tatiang,

Here are the blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/6/065f6fc974053a2034d1ae5d0ba4cb42ae2b227e.png)

And here is the result, as you can see the word “Prova” was written more than once (five times now)

 ![WhatsApp Image 2024-11-06 at 08.55.14](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/0/2055f066f4b8c302c7283a4369e276cc3290c324.jpeg)

---

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 6, 2024, 8:22am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/7 "2024-11-06T08:22:17Z")

</div>

Tried again with simpler blocks and the action is always performed at least 3 times

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/7/d705f5d05fbb9b68d0bcadbc73931d52d82e413d.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/6713029178f083a2f4b9f6e091db72d66dc5b28c.png)

And this is what happens in Airtable

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/6687f5df1469cd64baf29d44ccf03e92ebf5c0e6.png)

There are not multiple actions on that scan block and again, in the published app everything works 100%

---

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 6, 2024, 8:34am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/8 "2024-11-06T08:34:57Z")

</div>

It gives me a value of “4”

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/2/72f7c4f00d553845ae171e77c66859fb8a00d09f.png)  
 ![WhatsApp Image 2024-11-06 at 09.34.36](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/f/6f476f3a94ab14bea0fc2546d019c02317f333df.jpeg)

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 6, 2024, 11:21am UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/9 "2024-11-06T11:21:23Z")

</div>

Hi @maurizio.polverini89  
As we said in a separate support channel, this issue only happens with StP blocks on Android.

Could you please use the DnD scanner block?

You can find it here:

 ![image - 2024-11-06T131619.906](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/7/a7fb7d51aea34962337f420156e2e6418562d234.png)

And you can convert it to the advanced block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/5/25921e00142e766edb693612b3f6a2b9ec5bf87d.png)

---

<div class="post-metadata">

### Author: ![maurizio.polverini89](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maurizio.polverini89/32/145191_2.png) [@maurizio.polverini89](https://community.thunkable.com/u/maurizio.polverini89)
#### Post date: [November 6, 2024, 6:50pm UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/10 "2024-11-06T18:50:11Z")

</div>

It works!

Thank you very much for your help!

---

<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 4, 2025, 6:50pm UTC](https://community.thunkable.com/t/scan-qr-code-issue-repeating-the-action-4-5-times/3323899/11 "2025-02-04T18:50:47Z")

</div>

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