Save image to a file structure depending on logic

I have a table with a single image column. I want that image to be stored in the usual folder to start with. But if another column changes from TRUE to FALSE then I want it to save it (or move it) to a specified location, the folders of which don’t exist.

I’ve tried to look through various options and I can’t see for certain that this is possible. This seems to be the nearest to what I want - https://help.appsheet.com/en/articles/2848514-save-file-archiving.

The question is this even possible?

I reckon appsheet would generate the folder even which does not exist at the time when the file is in attempt to be saved.

I supposed you would like to generate the folder dynamically with certain conditions, and direct the folders where the file is saved also dynamically.

Did you try to push the IF and/or Switch expression within workflow setting?

image

We should be able to use the expression here, so I believe you can dynamically change the relative folder path based on the value in the other field in the same row.

Yes I saw your post about creating folders. But I’m wondering if it could move the image too. I presume you’ve not come across this behaviour yet?

In my past cases, I m always using default folders, so never experienced to use the other custom folders before… but from technical prospective, I believed it would work.
M time, what do you mean “it could move the image too”?

@1minManager,

Could you please update if the other column would change status by opening the record by user changing its status? Also could you please elaborate a bit what you mean by “to a specified location, the folders of which don’t exist.

Hi @Suvrutt_Gurjar

So as an example we have…
Test[Location]
Test[Section]
Test[Image]
Test[Complete] Y/N Default=FALSE

So when initially created Test[Complete]=FALSE, Test[Location]=“House A” and Test[Section]=“Wiring Test” it saves the image to /appsheet/Test_Images/.jpg. Sometime later someone goes in and changes to Test[Complete]=TRUE. Then it needs to copy or move the image file to /appsheet/House A/Wiring Test/.jpg. Creating the folders if required.

Someone else is monitoring the later file structure so we don’t want them to see any images until they are marked as complete.

Hope this helps to explain a little more

Hi @1minManager,

Thank you. Got it. Looks like something like Google script and or workflows as @tsuji_koichi mentioned may be required to make it happen at the backend.

I tested it. And I share my observations just in case these help. It obviously works to put the image file in two different folders based on initial TRUE/FALSE status and it even creates a new folder path based on some other column values in the same record. I used File/Folder Path option in the image column by writing an expression to direct file to two different folders. However once the status toggles , it naturally does not change the folder of the stored file in Google drive to a new one.

Someone else in the community may of course have a better idea. I will also revert if something looks possible.

1 Like

Do we have any scope in Appsheet to delete image files? Or to rename the actual files and references to them?

I dont think so unfortunately.

1 Like

Nope to both.

1 Like

Wouldn’t this work with a worklfow? Or can they only save files to folders?

There is no mechanism with appsheet for the moment to delete files on storage through the workflow.

Possible solution could be write GAS on backend.

1 Like