Skip to main content
Solved

Google Drive Connector


Forum|alt.badge.img

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!

Best answer by pallegama

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.

View original
Did this help you find an answer to your question?

2 replies

pallegama
Contributor
Forum|alt.badge.img+8
  • Contributor
  • Best Answer
  • July 27, 2017

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.


rylanatsafe
Safer
Forum|alt.badge.img+13
pallegama wrote:

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.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings