From today rowID not work in “Create a local data source”
Returns an undefined value
From today rowID not work in “Create a local data source”
I think the issue is that everything that it’s below this “create row” block doesn’t work. This issue relates to all Data Sources: I tried with Local and AirTable, and I found the same issue. I think this is a bug coming out of the latest release - yesterday it worked.
Thunkable team could you please check and let us know what’s happening? And how or when this will be fixed?
Yes, rowId doesn’t work, but the block “create” itself works fine for me
Hi @actech - if you try to include a few blocks below the “create row” block, these blocks don’t work. However, as you mentioned, the create block itself works.
Hope this clarifies.
My “create” block works in a loop and the blocks after it work fine
check it on scrLocalDBFilteredRecords in https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/
I also get errors. The exact behaviour depends on your way to run the app. For the sake of simplicity I reduced the block:
- when you click on “Preview” in Thunkable designer the loop runs, the rows get created, but the returned “rowID” is “undefined”. Some days ago (before the last update) “rowID” contained valid data.
- when you run this app in Thunkable Live (iOS 215-2, Android) the loop never performs. It crashes before the “S_label_status” can display any information. I have tested the “create row block” without any block inside, it still crashes.
I downloaded an app with “create rows…” block and it also crashes. So with the latest update we reached API 29, but the apps got new bugs.
Thanks for flagging this. We did some work on the way we handle the data source blocks recently and this issue must have been something we overlooked. The row does get created in all cases. I believe it should only be returning
undefined as the id for local data sources at the moment. I’ll have a fix in coming early next week. Have you noticed anything else misbehaving that I can take a look at? We obviously do testing to try and avoid issues but we don’t currently have all of the use cases covered it seems.
Hi @steven - I guess there is something additional to say from my experience with this issue today. In particular, I tried to make visible a button in absosute position after this “create row” block and it didn’t work.
For me, it seems the issue it’s impacting everything that it’s below the “create row” block - not only the rowID.
Please let me know if this makes sense to you. Thanks!
Can you share some of the blocks that you’re using where the error is occurring? I’m guessing it isn’t another, separate, issue but rather a symptom of the rowId value being undefined but of course I could be wrong.
Using tables, all of a sudden yesterday the update value stopped working.
The Button1 Alert will not fire if the update value is in the for each item j loop. Heck, I can’t get anything to work after trying to update a value in any Table.
Without the update value procedure, the Alert fires off correctly. I’m stumped, I’m sure this worked t’other day. I’ve tried this with multiple Tables, it’s as if the update value procedure no longer has the ability (permissions?) to update the Table.
yes, in this app I work with LocalDataSources.
The rows do not get created. Have a look at the following block, I inserted some debugging information by setting a label. When clicking on button the last thing my “debug” label says is “Loop count = 1”. Obviously the “create row in …” block does not execute. This happens in Thunkable live (iOS and Android) and in APKs:
That means, all blocks behind the loop never get executed.
In case I test my app with “Preview” the loop executes and the label says “Loop finished…” but all rowIDs are undefined. With undefined IDs I am not able to use the local data source in combination with data list viewers, a new and very important component.
Hope this clarifies.
I went back to an older project. Everything seemed to work. So I added a test
screen with a button and a switch. In the blocks I refer to a Data Source Table
that works in the older project.
The button text changes to nothing displayed. Using get value from ToDos,
does not work.
My original project actually does not completely work as it will display all the
items, using get value from ToDos, but I cannot update or create any items.
Thanks for providing additional context. I was able to reproduce the behavior where you don’t see the value being updated but I did not run into any issues where my alert was not triggering. I’m not sure what is going on there but if you would like to share a copy of your project with me (direct message is fine ) I can take a closer look. For the values, you are trying to set a boolean value (true/false) as Label text which should be a string. I’m certainly not saying that this isn’t something that we could/should support but as a temporary workaround you can use the
generate JSON from object block between the Switch value getter and the variable assignment to fix the issue. Of course this will mean that the value stored is
"true" rather than
true so it might not be exactly what you want. In either case, I can confirm that the value is being updated my data source in the recreation I did. I suspect the same issue is happening in your follow up post. If you changed the Button setter to a Switch I would guess that it would work.
Thanks to you as well for the added input and screenshot. I recreated your blocks as well and noticed that the items are getting created in my test. I did notice a separate issue which might be causing the confusion. It seems that the create row block for local data sources is not correctly inserting the new data until the data viewer component is refreshed. I’m going to work on fixing this now. I did not notice any other issues in my testing but obviously there can be something else in the project that is contributing so if you want to send me a copy link (direct message is fine ) I can take another look as well.
The rowID still seems doesn’t work - when I try to store the rowID in a list, it is shown as empty text.
The create block seems working (aside of the rowID) - however, once the Local data source is displayed in “Screen1” I try to create a row in “Screen2” (everything is within a Drawer Navigator) and then the App crashes.
I hope this helps! Thanks!
I believe the change to fix the rowId has not yet been released unfortunately. I think it should be out sometime today or tomorrow.
That is a bit concerning, I would like to take a closer look at that issue if you don’t mind. Can you share either a screenshot of your blocks or a link to your project? You can dm me directly if you don’t want to share it here.
@Steven while you’re at it you should just put the rowid in the data source table upon row creation. Seems like an easy thing to do that would save us some headache.
do you mean to automatically create a column “_id” in every Local Datasource? That would be a brilliant idea and would save us time. This new column would contain the rowID as you would expect. In the following block I show you what I mean. In this picture the id-column is not needed, but for later use it is very helpful, for example to search for an id:
@Michael_Rogulla that’s exactly it! Thanks for posting the example.
let me state it more precisely:
- the items get created in a local data source - good!
- after inserting the items in the local data source I switch to another screen and there we can see the items in a data list viewer (the data list viewer only refreshes when a screen.open events happens. It would be nice to have a block to explicitely refresh it) - good!
- the only problem I see is that the block “create row in …” always returns undefined as the rowID - bad!
With undefined rowIDs it is impossible to delete the items and refresh the content of a local data source. It is also impossible to refer to that local data source from other data list components.
You may ask “Why should I delete items in a local data source?”
- first: this used to work before the last update. I would love to see it working again
- second: if you want to create / recreate your local data source it is necessary to first delete all existing entries. Create / recreate happens for example if you would like to give a user the ability to search for specific items or narrow down the list to special entries.
Here is the block, that delivers “undefined” as the rowID. I can DM this project to you: