Google Drive - Create folder and Upload Files

Hi,
I have a set of .mp3 files which is download from a website and store it in a local drive (Say D:)
These files are renamed based on Date of the recording (format: YYYY_MM_DD)

Now i need to upload these files to Google Drive using Service Account key.
All this is working fine.

but my problem is there is a condition:

  1. Check if a folder by name “YYYY” exists. if not, then create a folder
  2. In Folder “YYYY”, check if folder “MM” exists. if not, create a folder with name as MM
  3. In Folder “MM”, check if folder “DD” exists. if exists, then upload the file into that folder, else create a folder “DD” and then upload.

While Steps 1, 2, 3 are working fine.
but each time it uploads, it once again creates a new folder and subfolders.

So Basically, it is not checking if “Path Exists” where i am checking for Folder’s existence.

Can someone help please!

@Jigar

Could you please show me screenshot of Path Exists activity and need to check once how you passed data.

@Jigar

I guess this activity won’t check this kind of links.

Just use Path Exists activity and pass path and see whether it is giving output as True or False.

Pls note, all this is within Gsuite Application scope.

I tried the same way in Local path and it works fine…but in Google drive it just keeps duplicating the folders and subfolders…it is not checking if the folder exists or not

@Jigar

Yes thats what am telling and Path Exists activity won’t work here. It will work with local path only.

The issue is, i want the bot to Check if a folder with name “YYYY” exists and if it exists then fine else create a folder by name "YYYY.

Do you get the gist of what i am trying to achieve here?

So what solution do you suggest for the activity that i am trying to achieve?

@Jigar

Sorry I don’t have idea on this.

Let’s wait for other replies and see.

Would using the Local GDrive Syncing Client be a workaround ?

Not sure if there is one at the moment…

Can you suggest some other work around or activity that i can use within Gsuite scope that can help me achieve what i am trying…

@Jigar

Not sure it will work or not. Just giuve it a try.

use Open Browser activity and pass that URL and scrape the data. And then check whether it contains that text “YYYY”.

Hi
I have a work Flow check if it works for you.
I have checked only for the Year component if you need for the date and month filter i can help you out.
did not add open browser you can add it later if it works check by keeping the drive open

Sequence.xaml (12.4 KB)

Hi Ashley,
Thanks for the response.

This is for Local drive paths right.

I need something which will check in my google drive if folder exists or not. if exists, then go into the folder and check if another subfolder exists. and so on until i reach the destination where i need to upload the file.
If folders dont exist, then i need to create one.

All this in Gsuite Application scope.

Will your .xaml file activities help? I am not sure…

i have used find children activity to do that and that will do on the google drive not on local drive
Check if it works. but you have to open the google drive because i have not used activity to open browser which you can add later.

Looks like you may Need to use the REST Interface

list GET /files Lists or searches files.

How were you able to upload your files into the newly-created folders?