Solved

Google Drive Connector

  • 26 July 2017
  • 2 replies
  • 11 views

Badge

Hello,

 

my goal is to delete a previous' week file from google drive and upload the file of the current week on a weekly basis.

 

The file name changes weekly.

 

This week I would like to delete report_201729.xls and upload report_201730.xls, next week it would be report_201730.xls to delete and report_201731.xls to upload.

 

The upload is working fine with the Google Drive Connector transformer of FME 2017, but I have troubles to delete the previous' week file. The transformer doesn't have a file name option, only an Object-ID, but this ID changes weekly.

 

How can I solve this problem?

 

Thanks!

icon

Best answer by pallegama 27 July 2017, 08:14

View original

2 replies

Badge

Hi @kat,

I hope this can be solved using an additional GoogleDriveConnector to obtain the Object-ID of the file you want to delete.

Since you already know the name of the file (or you can build it based on current file name using an AttributeCreator) to be deleted, you can send a 'List' request to retrieve the list of files in particular location (root or folder) including the file name (_name) and object id (_id). Then it is possible to use a Tester to filter the required record based on file name and pass the _id into second GoogleDriveConnector with 'Delete' request.

Badge +11

Hi @kat,

I hope this can be solved using an additional GoogleDriveConnector to obtain the Object-ID of the file you want to delete.

Since you already know the name of the file (or you can build it based on current file name using an AttributeCreator) to be deleted, you can send a 'List' request to retrieve the list of files in particular location (root or folder) including the file name (_name) and object id (_id). Then it is possible to use a Tester to filter the required record based on file name and pass the _id into second GoogleDriveConnector with 'Delete' request.

I think this a great idea! You could also use Published Parameters for the 'File to Delete' and 'File to Upload' and leverage the TestFilter transformer – in this workflow, it would replace the Tester.

 

 

Reply