scheduled app integration that runs with intervals automatically, read a file content saved on google drive
and saves this file content to a sql instance
which component should I use to access the text file on google drive ?
Hey @dareenhamdy , thanks for your question - We’re keeping an eye on this thread to ensure you get the answers you need, and we also invite the community to pitch in with their thoughts.
Your patience means a lot to us. Additionally, consider checking our articles and upcoming events!
To implement this scheduled integration on Google Cloud Platform, the components you should consider are the following:
Google Drive API: You need to enable this API in your GCP project to access the data stored files on your Google Drive.
Cloud Function: A serverless platform that runs your code in the cloud. Using Cloud Scheduler you can set it up to automatically retrieve, process, and save the file’s content in your SQL instance.
Cloud SQL: This is where you will store your data.
For authentication, create a service account with the required permissions across all services. You can also refer to this documentation for guidance on configuring OAuth 2.0 for authorization.
To read the contents from a file from google drive using app integration you need to do the following:
Create a google drive connection using OAuth 2.0 credentials.
Go to app integration to create an integration using the drive connection connector task.
Configure the connector to perform Action-> drive.files.export
In the input payload, provide two required parameters namely “fileId” and “mimeType”.
In the output payload, “ResponseBody” will have the contents of the file.
Below is an example of an input payload
{
“Query parameters” : {
“mimeType”: “text/plain”
},
“Path parameters”: {
“fileId”: “2lnvidvieEZcI9JdfZt6XFRC0p6uI0J_7PkF8iFDGrg8A”
}
}
fileId can be extracted from the file URL as follows: