I am following a tutorial to create a filtered sheet depending on the option chosen. Part of the process is to copy the rows of the originating sheet to a “Filtered” sheet.
The originating table is a simple 2 column sheet with 10 rows - A |1 , B | 2, C | 3…
I followed along with the tutorial but am getting double entries in the resultant sheet. In order to troubleshoot, I created a label and assigned the concatenated row number to it, but when I run this it works fine. As soon as I remove the block to set the label name, it goes back to creating double entries.
I also realise that even if I take out the Set Label1 text block and leave in the Set App Variable rowNumber, it also works fine.
Don’t know where I would put it to the right of the Create block and there is no connection there, but in both of the above instances, it still gave double rows. Actually, even when I set it to 5 seconds, in the second instance, there was a 5 second pause and then the 2nd rows was added immediately after the first, so the pause does not come between the action of adding to each row.
Assuming that I will get the double entries sorted out, I moved on a bit and change the destination table to an Local DB. I used tried both App Data Source and Stored Data Source but the data does not get added to the table.
I will give a bit of background to the app. Users will go through a series of screens (Vendor → Category (only those that apply to the vendor will be shown), → Brand (only those brands that apply to the category will be shown). They will then be able to add data by choosing a filtered list of items.
I know that I can do this with tables in Airtable or Firebase but it is possible that from time to time they may have spotty or no mobile service or Wifi, so I want the tables to be local.
I will change the app to have a button to update tables (something that they will do with internet connectivity) and then once they are in the field, the data used will be all local to the app.
Can you try moving all of those blocks to a When button click event block? I don’t think this is the issue but a long time ago, the When Screen Opens block would trigger twice when a screen opened. Let’s remove that from the equation.
I would also assign a variable to the number of rows block above the count with i loop and then use the variable for the count with i from 1 to ____ section.
The last thing to try would be to replace the create row block with a new one in case that one somehow got corrupted.
Again, just trial and error here… I don’t see an obvious reason why you should be getting duplicate rows.
I will follow this topic.
I think we are following the same tutorial.
When I wanted to have a filtered view, I found the tutorial on YouTube.
Tried the same steps, and I also got double data entries.
Someone else is trying to figure it out for me, but so far no luck. He already spent more than 10 hours on it.
I hope you can have the solution
I changed the Open Screen block to the When Button Clicked block and that fixed the problem. So as you said obviously a problem with the When Screen Opens block. How do we bring this to the attention of Thunkable?
As an FYI, also tested When Screen Starts and got the same duplicates.
Had used the variable as suggested. I just moved things around during the troubleshooting process.
Maybe try a timer that triggers after a few seconds or a ‘has been run’ variable that changes from false to true once it runs the first time. If the ‘when screen opens’ actually does open twice then it would make sense to use a timer that triggers the timer to start after it opens. The reason being it would reset the timer each time it “opens” then after the 2 seconds it could call the data. Sort of like the ‘wait x seconds block’ but removing the actual call from the ‘when screen opens’ block. Just a thought.
As I mentioned in a previous post, I also had this problem.
Today I tried to see if it also would fix my problem, When I switched the When Screen Opens, to When button Clicked, what this would do.
To my surprise, my Google Filtered View sheet stayed empty.
In the past, I had this problem to, but when I tried it the next day, it suddenly was working, but with double data entries.
I also tried to create a local sheet, but this is giving the same problem.
It stays empty.
Any idea what this could be?
Can you repeat what the exact problem is? What are the steps you take in the project you shared with me and what result are you getting?
Because my assumption is that that project should be creating a bunch of new rows in your local database. How are you checking to see if that worked? For example, by displaying the number of rows in that data source. And you may need to refresh the Data Viewer List after the rows are created with the block in this drawer:
The tutorial that I was following shows how to filter data from a Google sheet for display. So the process was to read all the rows from the originating sheet and if they meet the filter criteria place them in a filtered sheet that would then be used to display.
In the first part of the tutorial there is no filter applied so all the data should be replicated in the filtered sheet.
It wa during this test that I realised that I was getting duplicate entries. I added a label block which would show the row as the data was being processed. When the label block was added, the duplicity ceased.
That is whenypu suggested that I add a wait block, but my impression is that the duplicates are being created even before it gets to the wait block.