Hi. I’m building an app which allows the user to change their profile picture. To do that, I created a storage bucket called ‘Profile Pictures’. In my app, I have a file picker element in the My Settings page. In the Create rule for when a file is uploaded, I did the following.
Look dismiss the above the value is changing normally there’s nothing wrong but I got another issue now. The change is not permanent. As soon as I refresh the page or go to the starting home page, it defaults back to the previous profile pic. How to make it permanent?
Profile pic is now semi permanent. After removing the image binding and inserting the app variable, as follow, it stays when moving from page to page. But as soon as the app is refreshed, then the image is gone.
How to make it completely permanent even if the app is refreshed? Image binding field unfortunately only supports inserting images without app variables. App Studio has many missing features. I can upload and get files from a bucket but there is no option to even delete a file from it. The profile picture changing is dysfunctional as of currently. Hope the dev team can look into this post and add the necessary functionalities.
You can have Data services/entities here. The profile picture can be connected to the file column of entity. So whenever user updates a picture from app, the entity is updated with the user selected image and so the profile picture will be updated as latest since it refer to the entity column.
An example screenshot :
The “UserImage” variable is the binding variable for file picker.
In the entity, don’t choose the column, use the lookup function to get the record only and then update the file picker variable value to corresponding column below. Attaching screenshot below (havent mentioned image variable on screenshot, to show lookup fn)
Yes but I’m not trying to lookup an existing record that is already there. I want the user to as soon as they upload the profile picture file to the entity to fetch that exact file name so that it can be automatically set on the image.
Rather than just having image, have one more column say email or userid, populate a value for that in data service, then do a lookup to that, update image column corresponding to that, also map image placeholder with the same column.