How to get the createdTime from Result of Finds and Folder activity of Gsuit?

I want to extract the created date of folder on google drive. when i was trying to implement the find files and folder activity, in Output result we are getting array of file, how i can take created date from that variable ?

can anyone help on this?

Hi
Did we try with this expression to get the creation time, in Writeline activity

New FileInfo(Path.GetFilName(“your filepath”)).CreationTime.YoString

Cheers @Omkar_Deshmukh

Actually Im using Find files and Folder (Gsuit Activity) where in result “ResultFolder” im getting Modified Time, create Time.

so how i can get those values in Variable to compare with current date?

1 Like

No worries
Once after getting the output as Files[ ] from Find files and folders activity pass that to FOR EACH activity as input
Where change the type argument as Google.Apis.Drive.v3.Data.File in the property panel of For each activity

Inside the loop we can get the CreationTime and assign that to a variable of type System.Datetime which we can compare with a value or variable we have

Cheers @Omkar_Deshmukh

1 Like

Can you provide me a workflow? so that i can implement my one by comparing

1 Like

You can use Gsuite application scope and it has Find files and folders activity for google drive.

It return Google.Apis.Drive.v3.Data.File array.

Then pass this to FOR EACH activity and change the type argument as mentioned above in previous comment
driveFind_2

You can fine the property list by this

Inside that to get the creation time
Mention as
date_variable = item.Creationtime
Where date_variable is of type System.Datetime

Then we can use IF condition like this
date_variable = Now

Cheers @Omkar_Deshmukh

1 Like

Hi Palaniyappan,

when i was try to assign ModifiedTime to FolderCreationDate. uipath throwing an error as compiler error, disallows binding

Please help out

image

1 Like

May I know what is the error throwing
If possible kindly share that screen shot

@Omkar_Deshmukh

1 Like

That is compiler error…

Yah get the cursor to that blue mark in that activity so that we could know the error
@Omkar_Deshmukh

1 Like

image

1 Like

hi Palaniyappan

please reply

1 Like

Please reply

1 Like

Hi
Sorry for the delay in response @Omkar_Deshmukh

May I know what is the datatype of the variable MDate

Cheers @Omkar_Deshmukh

1 Like

That is file array object

Sorry I thought about uor asking about Result object.

However when I tried to print as log message by using item.name or item.id or item.createdTime all the time I’m getting same error.

May i know how can I ready values of that file array object of result in detail?

Usually item.ModifiedTime will be of type System.DateTime
We need to convert this to string with .ToString in order to mention them in log message activity or assign to a variable of type string

cheers @Omkar_Deshmukh

Hi Palaniyappan,

folderResult is type of Google.Apis.Drive.v3.Data.File

when i used to log message by using below scenerios im facing the error because im not able to provide item . methods any one which are mention over there in array

i was using to print as

item.name.tostring ----> error
item.createdTime.tostring----> error

folderResult.Name.tostring----> Google.Apis.Drive.v3.Data.File

Gsuite video, hope this will helpful: