PLEASE help in gsuite!

Hello everyone!

I am downloading files from google drive and uploading it to another website.
I have applied forever while loop because as soon a file is modified it will download that file from drive folder and upload to the website.
I have applied another condition that if in case the file is modified in last 10 minutes it will take that file only. But lets say if there are 3 files which were modified in the last 10 minutes, it keeps on downloading those files again and again and uploads on the website. Because it is a forever loop.

Can anyone help me with the logic that if a particular file of a particular time stamp has been downloaded from the drive, it does not download that file again.

1 Like

@Aditya_Kumar3

Create one list of string and add that File name and Timestamp once the file got downloaded from drive. And then check list contains that item before downloading that file. If it contains that item skip the downloading else download it.

Hey @Aditya_Kumar3

Is your number of files dynamic ?

Thanks
#nK

I understand but how would i do it…First i am making a new list…then iterating each items in the list and checking if the time stamp is not present in the list(will be true since the list is empty right now)…then download that file and add that files timestamp to list.
Then do this again.
But it is not entering the for each loop of the list. What am i doing wrong here?

image

Yes. The file can be modified at any time on the drive…as soon as its modified time changes, i download that file and upload it on the other website.

1 Like

Hey @Aditya_Kumar3

Just curious to know how are you finding the file modified time or when the file is modified currently ?

Thanks
#nK

for finding out the modified time: sheet.modifiedtime
for finding whether it was modified in last 10 mins: Sheetmodifiedtime>=Now.AddMinutes(-10)

PLEASE help me

1 Like

Hey @Aditya_Kumar3

You are almost done buddy.

But tell me one thing please, you want to upload a file which is modified before 10mins or whenever there is a Change?

If you say 10mins check is fine, the above method you posted should work ?

Thanks
#nK

as soon as there is a new file or an old file is modified, I want to download it and upload on the website. 10 mins should also work. The above screenshots that i provided, in that it is not entering the for each item loop.
Rest everything is fine. Just want to make sure that if a file has been downloaded then when the forever while loop repeats, it should not pick that file. This bot has to be run for 12 hours everyday.

1 Like

Okay great @Aditya_Kumar3

So just help me out with few things please,

As you can see a field ViewedByMeTime in the above image which is nothing but the props of the gdrive files

I want you to check and confirm whether this time time is getting updated whenever you download the files ?

Kindly for your confirmation

Thanks
#nK

Hi @Nithinkrishna
I am not using viewed by me time anywhere in my project. Only using ModifiedTime and it remains the same whether we download a file or do whatever unless the file is not renamed or modified.

1 Like

Hey @Aditya_Kumar3

Yes you are not using currently which is fine.

But I want you to check it please if it gets updated whenever you download the file.

So that we can use that param and frame a condition comparing with modified time.

Thanks
#nK

Hey @Nithinkrishna
I checked this but i am getting a blank value everytime in ViewedByMeTime. even after downloading the sheet it is giving me blank value

1 Like