Trying to create an update user profile form, but when I go to save, the record is not updating for some reason:
The user flow is this:
- User logs in for first time
- User creates profile
- User sees completed profile
- User taps edit icon to edit profile
- Go to edit page
- Form here should have previous inputs as placeholders
Update the user profile, Update user avatar if they updated image, and link back to the previous screen;
but nothing happens, any pointers? Thanks so much!
Happy to upload a loom video in the comment
Did you check if the data is updated in the collection or not?
Best regards, Victor.
Thanks for the speedy reply.
I just checked and it looks like nothing was updated.
So it must be something with my action to “update user profile” not updating?
It seems like there might be a problem with the action. As a test you can add a button with some “hardcoded” update (some field) and see if this field is updated.
Also sometimes Adalo DB in the builder doesn’t refresh the data immediately, so to be 100% sure that the issue is with the form you can run a test:
- update the user profile in the app using this form
- close previewer
- reload builder
- check database updates.
And one more thing: I don’t know much details about your app but it may be a chance that you have “Current User” and “Logged-in User” available. It is worthwhile to check that you’re updating the profile of Logged-in User.
Hi @Victor I think you’re absolutely right, I’m not sure why it isn’t updating my database.
There’s no where in the action button to change anything, because it is the default adalo form.
Here’s a video showing you what I’ve set up: https://www.loom.com/share/74e422d9c40543a485c2b22339d618dc?sid=8895487f-e0b0-4a81-9201-761e038ed3aa
I have it set up to update the “current user profile” which should be the Logged In User’s profile.
Thanks so much for all your help!
Here is the issue.
On “My User Profile Details” screen you have set up the User Profile as a list (around 3:00 on your video).
However, in order to edit the profile, you’ve added an action to an icon in the app bar. The app bar is not inside this list. Therefore, Current Profile data is not available on the “edit profile” screen. You can also see it in the form: usually when you’re updating a record using the form, existing data is always there. In your case the form is empty.
To fix the issue, you need to add some button/icon to the User Profiles list and add an action to link to Edit Profile screen - when you use this button to access Edit Profile, everything should work just fine.
As a side note - I would think about changing database structure in this section: unless your users aren’t using multiple profile infos, it might be a good idea to include all these fields to Users collection - in order to avoid unnecessary complexity and reduce the probability of mistakes.
That’s amazing. Thank you for mentioning that. I didn’t know it had to be included in the list, everything works now. I understand your note about the database structure, I’ll look into this.
Thank you so much!!!