# How do I make images saved to Stored Variables persist between app updates?

**URL:** <https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651>\
**Category:** Questions about Thunkable X\
**Created:** [April 1, 2022, 6:03pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651 "2022-04-01T18:03:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 1, 2022, 6:03pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/1 "2022-04-01T18:03:50Z")

</div>

Hi everyone,  
I’m facing a quite annoying issue on my app and I would like to ask your precious help. It is really appreciated and I would like to thanks in advance to anyone wants to help me.

**The problem**  
In my app you can save some pictures directly on the device, no cloud services involved here.

The fact is, when a user saves some pictures and then he updates the app from testfligth or similar (without uninstalling) it happens that the pictures are not visibile anymore.

This happens only with ios.

**Some implementation details**

The way I save pictures into the device is basically based on a **stored** variable list that I initialize once like in the following pictures.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/5/056e9d8cc1cbed6069c0be01f4efcc36275292ef.png)

Then, each time the user add a pitcture the following happens (see that the variable “picture” is the output of the device camera or a picture taken from library).

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/7/376e5247e1ff91d64b57c28b6e4e05ab2f948ca8.png)

**What I have already verified**  
I used some log in order to understand if the update of the app deletes some stored variables, but it is not the case.

In the following I show the two logs taken before and after the app update but they look the same

See the file path just after the user took the pictures.

“[{“img\_front”:“file:///var/mobile/Containers/Data/Application/F0B2FA01-4B88-4E3D-9C1E-EB2464D0416E/Library/Caches/ImagePicker/39855492-DCA7-467B-AB71-FC53E64823D6.jpg”,“img\_back”:“file:///var/mobile/Containers/Data/Application/F0B2FA01-4B88-4E3D-9C1E-EB2464D0416E/Library/Caches/ImagePicker/FA39139E-3DFC-4C3A-9CF4-FE77BEF7F9D4.png”}, …]];”

And then see the file path just after the user updated the app, they are the same.

“[{“img\_front”:“file:///var/mobile/Containers/Data/Application/F0B2FA01-4B88-4E3D-9C1E-EB2464D0416E/Library/Caches/ImagePicker/39855492-DCA7-467B-AB71-FC53E64823D6.jpg”,“img\_back”:“file:///var/mobile/Containers/Data/Application/F0B2FA01-4B88-4E3D-9C1E-EB2464D0416E/Library/Caches/ImagePicker/FA39139E-3DFC-4C3A-9CF4-FE77BEF7F9D4.png”},…]];”

I hope that someone can help.  
Thank you,  
Daniele

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 1, 2022, 7:19pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/2 "2022-04-01T19:19:50Z")

</div>

What is your exact input for the picture variable? What do those blocks look like?

How are you checking to make sure your stored list variable is accurate?

Are you accounting for the fact that your stored list has an empty object in the first item/index position?

Is there a reason you’re using an integer for the list item # when adding an object instead of using the more common method of inserting an object as the last item in the list? Are you sure those row #s already exist as list indexes (that is, you’re not trying to add an object as the 5th item in a list that only has three items)?

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 2, 2022, 8:57am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/3 "2022-04-02T08:57:14Z")

</div>

Thank you @tatiang for your interest. Below you can find my explanation. Let me know if you see something wrong in my implementation.

The behaviuour I’m observing is more like if updating the iOS App to a new version, removes some permission to the app, or something similar.

> “What is your exact input for the picture variable? What do those blocks look like?”

Photo from Camera is the input of variable picture

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/7/3748dd578ca3616bbb500f06be1d9502cdb10306.png)

> “How are you checking to make sure your stored list variable is accurate? Are you accounting for the fact that your stored list has an empty object in the first item/index position?”

I’m using the list as an array, this is because my app has 7 slot in which user can save pictures.  
I check the accuracy with some logs and for sure it is likely that the first position is empty and the second is initialized. This is a case in which user saved the photo in the second slot.

> “Are you sure those row #s already exist as list indexes (that is, you’re not trying to add an object as the 5th item in a list that only has three items)?”

I’m sure at least for two reasons:

- if the user does not update the ios App to a new version, everything is working perfectly, even if I kill the app.

- on Android everything is working perfectly, even if the user updates to a new version

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 2, 2022, 5:28pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/4 "2022-04-02T17:28:07Z")

</div>

iOS and Android treat data differently. In Android photos are part of the gallery and if you uninstall an app that you used to capture images, the photo will still exist in the gallery unless the app stores the images in the app related folder.

In iOS however, images taken by the app are part of the app data and in you remove the app, the images will be deleted and you will not have access to them the next time you reinstall the app.

To test that, install you app and take a photo then go to the iPhone photos and copy that image you took. Remove the app and try to locate the image again, you would not find it and you will only find your own copy of the image that you took from the phone gallery.

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 3, 2022, 7:18am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/5 "2022-04-03T07:18:31Z")

</div>

Thanks @muneer for your feedback.

I’m pretty sure there will be another explanation for this case.

I completely agree with you in case one removes and then reinstalls the app.

But this case is different because pictures disappear when one updates the app with a new version, without reinstalling it first.

For what I know from the logs, stored variables and their contents (like the list) are not deleted after updating the app.

Thanks again.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 3, 2022, 10:19am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/6 "2022-04-03T10:19:30Z")

</div>

[https://developer.apple.com/forums/thread/103935](https://developer.apple.com/forums/thread/103935)

It seems you’re not the only one.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 3, 2022, 12:07pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/7 "2022-04-03T12:07:28Z")

</div>

I’m just taking a stab here but if it’s kept in a cache, it may very well delete. The file-path indicates as such.

In that case, it would be more ideal to store photos in the devices memory or “save to camera Roll” like we can from other apps.

Seems the above is the default for Android per @muneer

I will touch base with our engineering team and see if we can find a solution or at leader more explanation. Thank you for raising this issue!

I’ll circle back later this week with an update.

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 3, 2022, 6:37pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/8 "2022-04-03T18:37:40Z")

</div>

Many thanks @muneer and @jared .

In the meantime I’ll will make some more troubleshooting and share with you any possible discovery.

I really hope to solve this because my app concept is based on the possibility to save pictures on the device, avoiding any cloud services.

It’s also the main reason why I choose Thunkable among other platforms.

Thank you,  
Daniele

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 7, 2022, 2:02pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/9 "2022-04-07T14:02:27Z")

</div>

Hi @jared did you discuss with the engineering team about the topic?  
Many thanks  
D

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 7, 2022, 2:05pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/10 "2022-04-07T14:05:59Z")

</div>

I haven’t heard anything yet. I may hear something today but will hear more next week for sure.

I will keep you posted! It’s been a busy week for the Eng team but your issue is not forgotten. It is still in our bug list to address/investigate. 🙂

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 14, 2022, 8:05am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/11 "2022-04-14T08:05:48Z")

</div>

Dear @jared , have you had the chance to speak internally about the issue? Sorry to insist but this is blocking for my business.  
If you have any possible workaround for me it’s ok, for example I wondering if is possible to save pictures in the customer’s cloud space like iCloud and Google.  
Many thanks  
D

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 14, 2022, 9:39am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/12 "2022-04-14T09:39:58Z")

</div>

> [@dani19130a](#):
>
> for example I wondering if is possible to save pictures in the customer’s cloud space like iCloud and Google.

Thunkable already has the components and blocks to save to `Cloudinary` which is a cloud storage so why do not you use it.

If I where you I would use both the `Cloudinary` and the `Stored Variables`. When the app starts it would first check if the `Stored Variables` are present, if not then the app would get the images from `Cloudinary` and save them to the `Stored Variables`. This way you can view selected images even if the phone is not connected to internet.

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 14, 2022, 10:30am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/13 "2022-04-14T10:30:40Z")

</div>

Hi @muneer ,  
thanks for the feedback, it’s all about a matter of privacy. I developed a wallet for identity documents and privacy (or the perception of privacy) is key ([click to see the website of the project](https://www.idilio.app)).

So, saving documents on the phone is the best solution for both me and customers because I have less constraints and risks regarding privacy rules (GDPR) and it is also much simpler to explain to customers that I cannot see their data by design.

Then, I’m thought about iCloud and G-Cloud because it is something out of my responsabilities, and it is something that user knows and probably trust more.

Finally, Cloudinary is a good solution in general but I think it is not in my case for three reasons, at least:

- it moves the responsability about privacy on me
- requests the implementation of registration and login step that I don’t have at the moment. The reason is that I’m working on an MVP and I’m trying to get the most feedback and value from the market with less effort as possible (you know that implementing login requests new screens, lot of testing, credentials management, it is also a killer for conversion rates)
- It costs $$$

Thanks again  
D

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 14, 2022, 10:37am UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/14 "2022-04-14T10:37:18Z")

</div>

In this case let me present you with two of my demo apps that, when joined together, could be the solution you are looking for.

1 - Save Canvas image to GDrive  
[https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe](https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe)

2 - Read image file from device and display it in the screen.  
[https://x.thunkable.com/projectPage/61f68431c3761001dba12df1](https://x.thunkable.com/projectPage/61f68431c3761001dba12df1)

When reading the image from device, I read it as `Base64` and when saving an image to GDrive I get the image as `Base64` so you can combine both to make your solution.

If you are developing in DnD then you only need one of my apps because DnD now has a `file picker` component.

See the tutorial to save image to GDrive

> [@Save Canvas Image to your Google drive](https://community.thunkable.com/t/save-canvas-image-to-your-google-drive/1609950):
>
> For this tutorial you will need to code a short script in Google Apps Script which you can access it from within Google Drive. You will need to use Web API component to talk to the script you created in Google Apps Script and pass the parameters using the Query Parameter section the the Body section. The Base64 image cannot fit into the Query Parameter section and therefore will will need to pass it using the Body section of the Web API. The Thunkable project is very simple and is used to demo…

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 14, 2022, 1:15pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/15 "2022-04-14T13:15:25Z")

</div>

Very interesting @muneer, let me think about it for some days and I’ll come back to you with a feedback.  
Many thanks,  
D

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 14, 2022, 1:21pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/16 "2022-04-14T13:21:38Z")

</div>

You’re welcome.

Another workaround is to create a backup trick where you ask the user for his/her email and send an app generated email with the images attached and send it to the user.

You can then provide an interface explaining that the user needs to save the attachment to his/her device and then your app will pick it up and save it again as `Stored Variables`.

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 14, 2022, 3:40pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/17 "2022-04-14T15:40:34Z")

</div>

Hi @jared please remember to kindly provide the update from you engineering team. It is very important to have that in order to evaluate all the options.  
Many thanks.  
D

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [April 23, 2022, 5:13pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/18 "2022-04-23T17:13:30Z")

</div>

Dear @muneer ,  
nice to hear you again. I have some more questions about your solutions and cloudinary, if you please can help me, it would be really appreciated.

> 1 - Save Canvas image to GDrive  
> [https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe](https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe)

It was a nice help but, I tried to find a way to change dynamically the stage background image but it seems not to be feasible at the moment.

Maybe, do you have any other suggestions on this?

> 2 - Read image file from device and display it in the screen.  
> [Thunkable](https://x.thunkable.com/projectPage/61f68431c3761001dba12df1)

I made so much tests on different devices and I discovered that on Android (at least on my phone - Samsung A52 - Android Version 12) it is not working properly when the user choose to import images from phone camera. In this case, the web view function “receive message” it is not raised, so the picture cannot be showed. This happens randomly but it is not acceptable for production use.

Did you have any experience on this? Have you some suggestions?

> Cloudinary

Finally, I was thinking about using Cloudinary and I would like to ask you (and the community) how it is possible to protect the user privacy regarding uploaded images.

I have this concern because, in my understanding, all the cloudinary links (image URL) are public so it is very easy for an attacker to steal pictures to other customers.

It seems to be very difficult to properly manage images on thunkable and this is quite frustrating.

Many thanks in advandce.  
Regards,  
D

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 23, 2022, 5:39pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/19 "2022-04-23T17:39:53Z")

</div>

> [@dani19130a](#):
>
> It seems to be very difficult to properly manage images on thunkable and this is quite frustrating.

Managing them in app is not ideal at this time if they dont persist between updates. I’ll look into this to see if it’s a bug or simply a platform limitation.

You would need to store them in a secure backend such as xano or Firebase storage. You could first upload to cloudinary, get a url, move to a new location, then deletw from cloudinary.

You’d have to set it up but could probably start testing for free before you ever have to pay a dime.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 23, 2022, 7:22pm UTC](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651/20 "2022-04-23T19:22:30Z")

</div>

I can have two suggestions, If you are using the DnD UI, then you can use the newly introduced [File Picker](https://docs.thunkable.com/v/drag-and-drop/files#file-from-device)

You can merge between this file picker and the `Firebase Storage` option.

**[Update]**  
Example:  
This is an image saved in the `Firebase storage` [remote control keys](https://firebasestorage.googleapis.com/v0/b/sample-structure-9d875.appspot.com/o/remote-control.png?alt=media&token=2a9c7d37-649d-47af-bd7b-2bf4f807fa1b)

[Next page](https://community.thunkable.com/t/how-do-i-make-images-saved-to-stored-variables-persist-between-app-updates/1813651.md?page=2)
