If you are going to store multiple pieces of data under user IDs in CloudDB, then you would have to either store a dictionary under each user name, or extend the CloudDB tags with JOINed suffixes, like /password, /loginHistory, /stressorList.
That would require changing the login and register code a little, in the tag generation and checking.
Also, I recommend pulling in TinyDB in every Screen, and use tag USERNAME to pass around the user name, once the user has passed login or registration.
You current scheme of passing it around at screen open block time depends on every screen doing that in all its screen opens, and would not work for screen close operations.
So I did all of your solutions and my login/signup button work! But still lost on two things one the day tracker it marks the day as completed but doesn't add how many day ( since I login in today the days completed should have said one). Then two the stress list I dont know if it is possible to add 10 things to the list each day or unlimited amount since I want the user to go back and be able to see the list afterwards.. Sorry if my message may sound confusing. And thank for all your help already I really appreciate it.
So here's a tag/value structure that could support your requirements:
(tag:value)
<userid>/PASSWORD: the user <userID>'s password
<userID>/STRESSORS: a list of all the possible stressors a user has in mind
<userID>/yyyyMMdd/STRESSORS: a list of all the stressors that user <userID> experienced on date yyyyMMdd
I use yyyyMMdd as a date format because it naturally sorts in chronological order.
Because it is fixed in length, it should be easy to break out its 3 parts and feed them to Clock blocks that generate more customized date formats, if you want to get fancy.
The back end (database) of an app is not a place for fancy, just for things that work right.
Destress_1 (1).aia (1014.2 KB)
So I tried that and after the user types in their feeling or what their stressing about when I click see stress list nothing is popping up
So for my relax and overcome screen i want to do the same thing I did for my stress screen but when I tried thia code again on the other screens it didn't work
So the function I have for my stress screen is the same function I want for my overcome screen and relax screen, but when I tried my same code with the stress screen, all three of the screens stopped working, so yeah.. the app below has the fixed stress screen but the other two are still a huge problem for me. ReLeaf.aia (1014.7 KB)
You did not say what you were expecting to happen versus what actually happened.
I signed back into your new app, and got the same stressors I added in my previous run, then switched to the Overcome Screen, where you go looking for another list, FEELINGS.
Because I did not add any, and because it was set to return an empty list of it found none, it returned an empty list.
But I notice you initialize global ListOfeelings to two sample values, immediately to be wiped out by the incoming empty list from CloudDB.
Were you expecting them to be returned instead of an empty list on first run?
I am in the feelings screen (Overcome), and was able to log and retrieve two feelings (gassy and sleepy)
I had to change ink colors to black to see them, and I had to ask for them to be displayed via the See Feelings button.
You forgot the extra cloudDB event block I had added to the stressors screen, that watches for updates to CloudDB and requests a new read, triggering a refresh of the List View on arrival.
So I believe I fixed my last screen, but a weird question: what device did you use to test out my app? I'm asking because I used my Apple phone and I think it's odd. Since one moment the code works, then i reconnet, and it stops working, weirdly enough.