Help Needed: Saving and Retrieving Data with TinyDB

Hi everyone,

I’m working on an app in Kodular that involves saving and retrieving product data using Tiny DB. I’m facing an issue with data persistence when navigating between screens. Specifically, when I move to another screen and then return to the Screen, the values I saved previously (like the number of products, quantity, etc.) reset to zero.

Here’s what I have so far:

Storing Data

I store values in Tiny DB whenever they are updated (e.g., after adding or updating a product).

But I don’t know How to Retrieve the data when screen Initialize

Despite setting values in Tiny DB and retrieving them in the screen’s Initialize event, the values reset to zero when I navigate back to this screen. How can I ensure that the data persists correctly?

If I can use another component, please tell me.

Any help or guidance would be greatly appreciated!

Thanks in advance!

Show us your relevant blocks so we might help you better.

First i saved all values

then when i go to other screen the values show correctly by using these blocks

But when i go back to first page it becomes zero

I would need to show your first page blocks .initialize

blocks (2)

Checks if the NameSpace is or has changed. Name must be the same on both screens for you to retrieve the data.

It is same on Both screen

??
image


blocks (2)

Your problem is the extension or at least you don’t show the data loading in it, among other previous configurations

image

blocks (1)

i am using latest version of this extension but i don’t have updated on community

1 Like

You can upload test aia here. So that anyone can check it …

1 Like

I can’t do this if anyone can help i can share screenshot in PM

1 Like

Just create a test aia & upload it … Don’t post your main project.
@devxlabs

Ok i’ll upload soon

1 Like

no problem, works as expected

and when go back to screen1 does it give the same value wait i am sending a video

Use other screen closed block that will detect when you return from ther screen to screen1 where you can retrieve the data from tiny db.

Also follow other suggestions like namespace should be same, use checks to check the data is not empty before receiving the data.

Check this Video Please

Thanks Everyone for helping i was totally unable to find out where was the error so i jave reset all blocks and started again project.
Thanks everyone especially @Professional