How to Save date of Sign Up of user specific to a user in Firebase and display it?

Hello. I have made a system where users can upload/click their picture and it gets saved to their account in the cloud in Firebase… I followed the Thunkable YouTube tutorial and works like a charm

But now i want to save the date when a user signs up to the user’s account but its not working! Sometimes it displays the date but doesnt save it… other times it returns null… pls can someone help me with the logic?
Thank you,
Regards.

It’s probably an issue with slashes (/) which are used to denote Firebase paths. When I stored date strings in Firebase, I converted them to dashes (-).

If that’s not the problem, post a screenshot of the blocks you’re using.

1 Like

This is the current code… I removed the logic i used to save the sign up date

Why? Isn’t that the part that’s not working? That would be the part we need to see.

Also, what happens if you save a different text string to Firebase such as “this is a test”? Does that work? If so, what happens if you save “12-17-22”? Does that work? If so, what happens if you save “12/17/22”? Does that work? In all three cases, make sure you are hard-coding the text strings.

1 Like

Okay i’ll put the logic back then.

Yes, i tested with text in the cloud variable and it returns null. But if it is numeric value it works properly
i tested 17/12/2022 and 17-12-2022 and they both work.

Also, i am trying to save the date of signup in one screen and displaying it in another screen, just for clarificiation.
Thanks

My new logic… but it doesn’t work pls can you help me?


With those newest screenshots, does the saving to Firebase work? Do you see the date in your realtime database?

And does the displaying of that data in datecreated's Text work?

Unfortunately, i cannot see the date variable in realtime database nor does it display any output…also after adding those new blocks, after i press sign up, it signs me up but doesn’t auto redirect me to login screen.

You’re telling me conflicting information in each post so I’m not really sure how to help you at this point.

But if it’s not navigating to the LoginScreen then you have a problem with your cloud variables in the signup function.

Yes the cloud variables are the problem only. How do i fix it?
Please advise.

Thank you,
Regards.

You’re creating an object with a null value for the “date” field. You can’t store null values in Firebase so you need to give it a value such as “” (an empty string).

Ohhh i see. Thank you for your help!!

I had one more question actually…I have stored my assets (pdf files) in OneDrive and have created direct download links so when a user presses download, it opens the webviewer and auto downloads the file which is great… everything works!
But my question is that can i store these same files in firebase and then download from the database to the device directly (will it be faster and less tedious)? Or if it isn’t possible then its fine… the OneDrive method works

Thank you,
Regards.

You may be able to store PDFs in Firebase storage but I don’t know much about that. I don’t think it would be any faster than OneDrive. Cloudinary is another option for cloud storage of PDFs but OneDrive is probably fine.

But how do i download if i’m storing it in firebase/cloudinary? I thought thunkable will have dedicated functions to download but that’s not the case. So i’ll stick with OneDrive cos the download links never expire.

Thank you!!

No, Thunkable doesn’t allow downloading of files. It would have to be on the browser’s device using the Open Link block.

Yes. Thank you.

Actually i made a screen called download center and everytime a user presses “Download” from some other screen it will redirect user to Download Center, change WebViewer’s URL to the downloadlink and download file. Best part abt this design is that the user never leaves the app!! Also the web viewer is hidden and the user sees some animation for 5 secs and then goes back to main screen!!

1 Like

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