So, I’ve figured out how to create a set of actions that “copy” an image from one table to another. The issue I’m running into is that one app captures the images, while another is doing the work moving them between tables. Having them be two separate apps is an absolute must. The issue comes in when I copy the image from one table to the other, it’s not actually copying the image at all, but a relative folder path in Google Drive. The receiving table doesn’t use the same folder for storing images as the source table, so when it gets to the destination table, the image doesn’t appear (you get the “ghost image” icon in the app). Is there any way around this issue? Thanks!
Images are never stored in tables, only the path to the Image is. Images are stored in a Cloud file service - Google in this case. While AppSheet can upload images to the cloud service or delete them from the cloud service, it does not provide any cloud file service management functions -such as moving or copying files.
I understand this is a requirement for you from a functionality perspective. Is there any reason why both apps cannot use the same file storage location? Why do you need to move or copy the files?
From a Cloud file storage perspective, most clients try to avoid duplication of files and images to keep storage space ata minimum and avoid extra fees for extra storage space.
Sure, I realize that you’re basically just storing the file path for each photo once the image has landed in Google Drive. The issue is that both apps have existed separately for some time (one several months, the other several years) and have considerable separate sets of photos. I am leery of attempting to combine them into one storage location over concerns around the apps losing access/visibility of a portion of them during the relocation, and/or the small risk that some of them may have the same filename and cause conflicts in that regard since they were named and stored separately for so long. There are thousands of photos. There is now a desire to integrate them, and that is my challenge.
Edit: I should add that my hope is that somebody here is more well-versed than myself in Google Drive pathnames… Is there perhaps a workaround that would involve translating the path that lands in the target app to permit visibility in that app? If this were Windows or Linux, that sort of thing would be feasible.
@WillowMobileSys …It turns out, I didn’t have to relocate all the photos. Your statement sparked an idea. Instead, I moved the smaller number of photos in their folder (not co-mingling them with the other folders) and the spreadsheet file into the same folder with the older, larger spreadsheet table and sub-folders with the more numerous photos. This solved it without changing anything else because the relative paths remained the same across both apps. At least, I haven’t encountered any problems so far!
Glad you found a solution.
It’s also possible to make publicly shareable URLs to photos. So, if you were not concerned about security issues associated with that practice, that might have been another way to solve the problem. But, in your case, I think your solution is best.
Oh, actually, I see now that what I had posted wasn’t exactly right. This is better:
CONCATENATE(
"https://www.appsheet.com/template/gettablefileurl",
"?appName=", ENCODEURL(CONTEXT("AppName")),
"&tableName=", ENCODEURL(CONTEXT("Table")),
"&fileName=", ENCODEURL([image-or-file-column])
)
If it helps any at all, from an organizational perspective, if I have multiple apps that are sharing files between them, I will create a common Default app path that they all share.
I might create a path named “appsheet/data/CompanyName” and then assign this to all the apps that share information. When AppSheet creates the “Files”, “Images” and/or “Content” folders by any of the apps, they will be created inside this common Default app path and are avaialble to ALL the apps set to use it. Any data inserted into the folders is immediately made available to all of the apps.
If you have data that needs to be isolated to a particular app, then create a folder named, maybe “appname-12345”, the typical one used for the Default app path, and specify this folder in any area of the app where you want files or content only available to that single app.
I hope this helps!