There are many posts in the community about wanting to delete the image files also from the Google drive when a row in a table is deleted.
One can do so using the feature of “Folder as a table” introduced around one year ago. We can use this feature to delete the image and other document files from the Google drive itself when the row in the app is deleted.
Steps
-
Add the folders names from G drive where images and files from the app are stored as tables in the app.
Document Processing - Folder as a Table -
Make these newly added (folders as ) tables with delete permissions. In the image below the table “ImagesnFile_Files_” is the folder in G Drive where files are stored.
-
Create reference actions from the normal table where these images and files are used to delete the images and files when the row from the app is deleted. The referenced rows of the image / file folder tables can be obtained from the below expression
SELECT(ImagesnFiles_Files_[_ID],CONTAINS([Path],[ID]))
The important point here is that the Image and file folders based tables have a [Path] field that always contains key of the table from where the image was saved. The path field of the Image folder table is shown below
The image below shows how the image path is saved in the table where the app saves the image in image type column. As we know, an image or file always gets saved with the key of the table appearing in its saved path.
![]()
So essentially we can use the key of the table where the row is saved to reference and delete the associated image from the image folder table with reference action. The point to note is that referenced delete action on the folder table deletes the image from the G drive itself
You can have group actions to first delete the associated images or files from image and file folders in the G drive followed by the delete action on the table itself where the row is deleted.
The deleted inages from G drive go to its trash folder from where those are automatically deleted after 30 days.
Point to note One need not depend on normal table record to be deleted to delete the associated images or files in the record from the G drive. One can simply delete the images and files from the folder tables itself. One however needs to be careful that these images or files are not set as “required” and “labels” or main images in deck view etc. to break the app or lower the app usage experience.
Associated posts and requests
[Delete Image with Deleting a Record](https://community.appsheet.com/t/delete-image-with-deleting-a-record/18382) Feature Requests
Hello AppSheet Team. Great job and congrats for your Google Cloud merge. When “deleting a record”, it would be great if we can have the option of “deleting or keeping” the attached “image”. Thank you
[Housekeeping](https://community.appsheet.com/t/housekeeping/62188/4) Questions
One option is to use AppSheet’s new feature of folder as table. Once you create a table based on folders of your images, you can delete them from the app. Though please note the following The images go to the trash folder of the G drive . G drive trash anyway gets emptied automatically after every 30 dyas. The image reference from the other tables is not removed. So if you have image path stored in some other Appsheet table when you captured the image through app, that path will continu…
[Image files of Column type Image don't get deleted from Google Drive even if the row is deleted](https://community.appsheet.com/t/image-files-of-column-type-image-dont-get-deleted-from-google-drive-even-if-the-row-is-deleted/61422) Questions
Image files of Column type Image don’t get deleted from Google Drive folder where the are saved even if the row is deleted from the Appsheet App. This takes up space in the Google drive even though these files are no longer required. Please let me know how to delete them when we delete the row from Appsheet App. Thank you!






