Can't write row to local databse

I am sketching out a diet and fitness app. It will have a locked master food database and private user list of foods. My trouble at the moment is adding to food items to the user’s list, which is is a stored local data source. The symptoms are similar to Create Row block - is this how it is used? but I’ve already taken the debugging steps seen there.

The user is expected to pick a food from the master list which is passed to this screen where the user can decide to add it to the user food list.

The bottom button and labels are for debugging as we will see. There are over fifty nutrients, only a few are shown for now. The local database is pre-populated with four items.

I expect that the ‘create row in <>’ block is what I need. I’ve gone through the trouble of setting up every field, as I thought an incomplete specification might have been the problem.


The block on the right is the ‘dummy’ button, which should push fixed data into the new row, eliminating the possible errors in the left block. The navigation blocks have been pulled out from the bottom and debugging data label outputs added.

The debugging labels change as expected from either button, but no rows are added to the local table.

Hi,

If you are opening the table to see if the rows are added, don’t. Once a table is created manually, if you add data via blocks you cannot see them when you look at the table. I have asked about this but the situation hasn’t changed.

What I recommend you do is to use a Google Sheet in the first instance to ensure that you can do basic CRUD.

Once that works you can then transition to a local database.

Steve

1 Like

Thanks.
This actually occurred to me late yesterday, working on another part of the app.
Local stored databases simply aren’t touched in the web preview mode. (Might they work if I did a live test on device?)
So yes, I set up a couple new Google sheets for ‘Meals’ and "‘MealItems’ and they are being updated correctly. I also cut it down to four nutrients for testing - many fewer code blocks to throw away later.