My tinydb data are reseted when i close and open app again

I have a problem about tinyDB store block. I save a data from application but after i open application tinyDB was reseted? how to get the old data?

are you store and get with same tag ?
when store, you use a number as tag, but when get value, you use a string?

Is there any tag named stage? ( I suppose getstat is the name of the tinyDB?)

What i can see is that you're using a variable get global stage as tag when saving data but when retrieving it, you're using stage tag. Since there is no stage tag, you're not getting the data/value stored in tinyDB

mybe, it is make a different?

I get another problem. I added imagepicker in my own application but when i select a image the application close automaticaly. what happen with this?
gambar
gambar

also, i have changed the tag to number.
gambar

Try setting the fotoprofile image to imagepicker1 selection.

thank you for response, it's work.

Welcome :wink:!

can you see my code block what's wrong with my code?
I want to display data in chart but it just effect when we haven't closed yet.
I want the data from tinyDB will display again when I open the application.


this is my project
timerRemake.aia (918.1 KB)

I don't understand. What do you want to do?

I collect data from application and save it in tinyDB. the data will be displayed in chart on the second firtual screen that i created. in the begining, the data have displayed on the chart of the second V. Screen (just say it). but after I closed and open again the application the last data that displayed before it was gone and only cartesian's diagram number are displayed. I think the data from tinyDB are reseted when the application are closing. I don't get the solution for that and I am throwing this problem to this forum to get clearly the answer?

What's weird is that your designer screen in the photo and and the designer screen of the aia. provided by you is different! I don't know, why!

I noticed another thing- is there any tag named onoff where you're storing data in fireDB?

yeah

But I've not seen any tag called onoff where you are storing data

it is from microcontroller, I just want to get the value. It's different case with tinyDB. TinyDB are storing value from timer. You can see "storedata2"

You have asked the same question several times now.

Here is a simple example of how you store and retrieve a tinydb value

image

On first run of the app, the label will be 0
When you click the button, a random number is set to the label and saved to the tinydb tag "number"
This will continue to happen everytime you click the button.
When you restart the app, the latest value stored in the tinydb will be returned to the label

1 Like

You seem to be storing readings one per tag.

If you want to graph all the old readings, you need to get all the old tags and values.

Here's what seems to fit your storage technique ...



timerRemake (1).aia (918.6 KB)

You might want to leave out that clear block.

Blocks are draggable.

P.S. You know your two TinyDB instances use separate Namespaces, right?
That's why I made the choice of TinyDB a parameter to the procedure.

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