How do I create journal entries that are added to listview?

Hey all,

I'm trying to create a game where you enter various prompts which are saved as a "journal entry." The problem I have right now is twofold.

First: how do I make it so that every time I save a new entry in tinydb is checks to see if there is already an entry with that name, then increments a number by one? For example, the first entry is "Journal Entry 1." When you submit again, it checks to see that "Journal Entry 1" already exists and makes the next one "Journal Entry 2."

Second: how do I make it so I can add those journal titles (entry 1, entry 2, etc.) to a listview and, when chosen, show the relevant journal entry associated with them? For example, you could click on "Journal Entry 1" and it would display the text you saved.

I've attached the .aia file I'm working with so far. I'd really appreciate any advice.

Thanks,
Haley
FinalFourteen.aia (6.6 MB)

I see you're up to 10 screens already.
You're nearing the limit.
Also, you are not closing your Screens as often as you open them.

See the general Screens Advice in

I also see you don't use the Clock component from the Sensors Drawer. It can be used to generate unique and ascending timestamps you can text JOIN to TinyDB tag prefixes to create unique and ascending tags, like journalEntry2024-11-21-16:14

That way, the user doesn't have to type in dates and times, but instead the app can used Clock1.Now() reformatted properly.

Using the TinyDB GetTags block, you can get a list of all the TinyDB tags. You can loop through that list, filter it by prefix (text CONTAINS), and make a list of values, that you can feed to a ListView's Elements.

I recommend reading the introductory articles in these FAQs.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.