About TinyDB to show item by item

Hi,
Merry Christmas!
The attached is a TinyDB project to store and show notes, also used a Kio4_TingyDBx.
problems:

  1. It didn't show in order stored sequence, but show the sequence of date and alphabetical order,say the stored group as: 26/12/2021 20:19 zhangsan note / 29/12/2021 20:21 Lisi notelisi
    but the shown picture can't see that.
    The last 4 lines on the last picture is the shown result.

  2. how to show item by item by the button 'next'?
    Thanks
    Adam

ADAM_DIY_TinyDB.aia (17.6 KB)

1 Like

complement:
does the 'shown all TinyDBx' possess the sort function even in both number and character? I did't see sort blocks in the design page.

1 Like

How are we to know which textbox is which, if you did not rename them properly in the Designer?
txbDate
txbTime
txbEvent
txbNote
...

Your tag design is all wrong.
If you want to see events in time order, you need tags that increase as the date/time for the events increase.

You have 2 alternatives for such a tag design:

  • milliseconds from 1970, using the Clock component's time conversion blocks, or
  • yyyymmddhhmmss datetime format, which is sortable by date/time.

By the way, TinyDB tags are sorted, so your events would be retrieved chronologically in a Tag List.

There is no law saying you have to use readable formats as your TinyDB tags, if you are served better by less readable but more functional tags. Just use text and Clock blocks to convert those datetime values in and out of readable formats on their ways out and in of TinyDB.

For saving both an Event and a Note under the same tag, you can choose between several alternative ways:

  • use two TinyDB Namespaces with datetime tags, one for Events and the other for Notes.
  • Store the Events and Notes together in one TinyDB, together in a list (event, note) under each datetime tag
  • Store the Events and Notes together in one TinyDB, together in a text value event| note under each datetime tag. Split them at | to separate them.
  • Store the Events and Notes together in one TinyDB, together in a text value event \n note under each datetime tag. Split them at \n to separate them. (\n is line feed).
2 Likes

Thank you ABG, Merry Christmas to you.
again thanks for the detail advise.
I'll do the fix follow yours.

2 Likes

Thanks.

  1. deleted TinyDBx, and left TinyDB;
  2. added toolsForAI2, why its minute shown 02 as 14? (added 12)

ps

1 Like

24 hour format....

2 Likes

Thank you TIMAI2.
I changed the code as below, still can't get the 24 Hour:
26

1 Like

you are trying to set the fontsize of Label6? does that make sense?
what are the 24 hours you are talking about? what do you get and what do you expect instead?
also what about following that advice?

same for labels and buttons...

are you familiar with Do it?

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

2 Likes

Thanks.
Done now. BTW: the font size is a mistake.

ps3

1 Like

Thanks for all helps, Merry Christmas!
The time hour format is working now.
the still questions:

  1. the Clear_All doesn't clear all, but clear just some thing;
  2. Shown All TinyDB didn't show the format as expect;
    Thanks for help please.
    My excepted shown:
    ps gd
    READ ALL just shown one input:

    Shown All TinyDBx shown mixed results without full content:

ADAM_DIY_TinyDB_m_1 (1).aia (30.8 KB)

1 Like

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...
in your case the ClearAll button click event and the Show All TinyDB button click event... I expect, that you meanwhile renamed the components (textboxes, labels, buttons) accordingly as @ABG already suggested for easier understanding of the blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

2 Likes

Thanks.
The blocks here:

1 Like

unfortunately you still did not follow the advice

let me suggest you to do that and post again an updated screenshot
thank you

EDIT: btw. if you want to show your tasks, then you should use the TinyDB.GetValue block...

Taifun

1 Like

OK.
this is a new one. questions:

  1. how to get the shown all list Vertically and sorted in Lable6 instead of Horizontally as picture?
  2. clear All not work;
  3. tried DI IT didn't get result?

Thanks.
New Blocks:


shown result:

1 Like

maybe start from giving your component a meaningful name

1 Like

Did you check them? please let me know which one need be meaningful?

1 Like

which one is lable6?
you already have the data listed vertically in tjr list view.
i did not see any block for clear all.
which block you try ' do it' and waht result you want?

1 Like

If the component is touched by your blocks, then its name should be meaningful so that those blocks will make sense.

That's basically everything, except for dead padding labels.

1 Like

the label6:


label6 shown:

clear All:
clear all

1 Like

not the best text for a tag > \n :upside_down_face:

3 Likes