String too long for list? - TinyDB issue

Hello friends!

One of my apps is designed for professional drivers and offers the possibility to store comments for certain addresses. Comments are stored together with the address in a list and in TinyDB.
When restarting the app, an error message appears, which seems to occur only when a comment has been too long. Because I suspect the problem is really due to length, I would like to know what the maximum length of a list entry is. Could it also be due to something else, I would be very grateful for any hints.

Many greetings


Screenshot_2023-03-10_21.29.11

Could you capture that TinyDB value into a global variable, and apply some diagnostic blocks to it?:

  • is a list?
  • Do It (Companion Blocks Editor comment bubble)
  • length of list

Also, which type of ListView (MainText / MainText and DetailText, etc..) is ListView_Notizen?

Also, why do you store all your addresses and comments under one tag?
Would one address per tag be simpler?

P.S. TinyDB is stored only on the current device.
Would your proffesional driver want to share comments on an address with other drivers, like in a shared Google Sheet?

2 Likes

Thank you very much for your reply.

I will try to use diagnostic blocks.
Unfortunately I am still a beginner in app development with MIT App Inventor. Therefore, there is a lot I may not know or understand yet.
Because the particular comment always refers to only one particular address, these two pieces of information should be displayed at the same time.
ListView is currently set to "MainText". I had tried to use ListView with the layout "MainText,DetailText(Vertical)", but this did not work at all, because the information was displayed separately.
Drivers don't need to share the comments with others, just save them for themselves. Therefore a Google Sheet will not be necessary.

TinyDB2.GetValue is not a list (after Button_Notiz_speichern has been clicked):

What is the goal of the app? Why should it be displayed in a ListView?

This type of app is so simple, it's easier to just post a sample.

This is a note taking app for addresses in Washington, D.C., with a couple of sample addresses and notes...
blocks


Capture2
Capture3

TinyDB_Address_Notes.aia (2.3 KB)


1 Like

Well, it seems that all TinyDB tags previously saved with other apps are also listed here - at least while testing with Companion.

Thanks to all your helpful comments, I managed to solve the problem.
I got rid of the list because it was indeed redundant.
TinyDB together with an additional label did the trick.
You're awesome.

1 Like

Fine, then post your blocks so that others can also learn from it.

I would have suggested something like this:
TinyDB_Address_Notes2.aia (3.5 KB)

A TinyDB Namespace of 'addressNotes' would have avoided that, had I given a hoot.
TinyDB_Address_Notes.aia (2.4 KB)

1 Like

Here are the new blocks:
Screenshot_2023-03-12_18.38.23
Screenshot_2023-03-12_18.39.33

1 Like

Thanks for sharing Heidar, much appreciated.

1 Like