Images get stored in the wrong folder

The tables in my app have the access mode “as app user”. The tables are shared with all the app users.
Since some weeks, images captured by this users are stored in the wrong folder. That is: My Drive > Images_Folder. But not all images: some of them get stored in the right folder.
Images captured with the admin’s account get always stored in the right folder.
As you know, the App can then not show those images, when they are in the wrong folder.
AppSheet Support did not find the reason yet.
I wanted to share a Google App Script that I use to move those images to the right folder:

function MoveFiles(){
var files = DriveApp.getFolderById("CORRECT_FOLDER'S_ID").getFiles();
  while (files.hasNext()) {
    var file = files.next();
    var destination = DriveApp.getFolderById("WRONG_FOLDER'S_ID");
    destination.addFile(file);
    var pull = DriveApp.getFolderById("CORRECT_FOLDER'S_ID");
    pull.removeFile(file);
  }
}

Has anybody else the same problem?

2 1 104
1 REPLY 1

Hello @Fabian, I have not encountered this problem yet, just wanted to thank you for posting the script hehe.

Top Labels in this Space