Edit a cloud variable only at second attempt

Hi again,

I have successfully created a cloud variable to store user data, however on Android, when I try to edit the data (for a strange reason) it only works at the second attempt or the following ones without exception; whereas on iOS it crashes at the first try.

Any ideas what might be happening?

Thanks

Hi,

If you give a link to your project, it will be easier to understand the problem.

My bad, hereĀ“s the link.

https://x.thunkable.com/copy/cdb3193d0c8620dc4a5afa85bb0d826d

The cloud variable is created at the screen ā€œPerfil1_editā€ and then it is edited at the screen ā€œMenuā€

Thanks

I understand correctly that the app crashes on iOS when working with a cloud variable? If this is so, then it seems that there is a work with a non-existent object. Using the ā€œgenerate Object from JSONā€ block, check the value of the variable. It is probably null.

Ok so here are all the things I did based on your suggestions:

  1. Check for the null value with the " ā€œgenerate Object from JSONā€ block"
    R: it was not null

  2. Asigned a label text to that generated JSON, then try to edit cloud variable with the text from that label
    R: still crashes on iOS; still editing is succesful at 2nd and further attempts

  3. Initialized a new app variable to create an object; generate a JSON and asign that item/text to the new app variable; then try to edit cloud variable with the text from that app variable
    R: still crashes on iOS; still editing is succesful at 2nd and further attempts

IĀ“m not sure what else can be made.

Can you try to create a very small example project that demonstrates the error and send out a share link to that?

-Mark

IĀ“ll try to do it, also I will put the new blocks that apparently work fine!

PS: I sent you a very very important DM. Please help! haha

HereĀ“s a small example of the version with the erros I mentioned (Incorrect screen) and the one I recently created without errors (Correct screen).
https://x.thunkable.com/copy/b7e048796c6a322b3c0d1e928f0870a7

David,

Thanks for the smaller, simpler project to test. Could you tell me what steps I should take to demonstrate the incorrect behavior?

-Mark

Incorrect screen

  1. Hit edit
  2. Hit edit for the specific value to edit
  3. Select an item from the list
  4. Save and confirm

On iOS the app crashed. On Android it only worked after a second attempt.

How are you testing whether is worked or not?

-Mark

I just realized I forgot to add a ā€œCancelā€ button in the app I shared. ā€“ The purpose of that button was if the user regret to do the changes and cancel the operation before submiting. By doing that it reseted everything as if the screen just opened ā€“ So when the issue happened I canceled the operation with the cancel button then tried again and it worked. Everytime I closed the app and reopen I had to do this double process of editing to make it work.
I hope I made myself clear haha

I would still like to know what steps you took to test whether the save worked.

I was looking directly at my Realtime DB to see if the change was done correctly after saving. I donĀ“t know if that is what you meant.

Yeah, thatā€™s what I meant. Thanks.

-Mark

1 Like