cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Folder inside Parent with property of document created,uploaded or inserted in ParentFolder

piyush48
Star Contributor
Star Contributor

Hi All,

I want to create a Folder in Parent by reading Property from document inserted,created or  uploaded in Parent and then move that document to that folder.

I am getting some idea that how it may work like i have to create rule on parent with criteria when item are created or enter this folder, then i have added my property in all criteria met. Now my question is my property is of type d:text and can have upto 6 characters and in the condition it has condition of begins with,equal to,contains, end with . so what should i provide in it.

Also like i have around 1000+ document to be created . so how to create script which will move this document to the folder created on the basis of each document.

Please anyone can guide me on this issue will be great help.

Thanks,

Piyush

7 REPLIES 7

kintu_barot
Star Collaborator
Star Collaborator

You can use the 'Execute Script' option.

First, you need to write a script to perform the operations to be performed on the document.

Save the script in <name>.js format and upload it to Repository -> Data Dictionary -> Scripts

This script file will be listed when you select the 'Execute Script' option in 'Perform Action'.

Using such scripts you can perform any operation you want.

Regards,
Kintu

Hi,

I want create folder by reading year property from created date and if document increases by 1000 then to create folder on basis of month and move that document to that folder.

@abhinavmishra14  any views or idea you can provide me here??

kaynezhang
World-Class Innovator
World-Class Innovator

Following is an example

// get parent folder of current documnet
var parent = document.parent;
var year = document.properties["**:name"];
//create
var yearFolder = parent.createFolder(uploadDirectory);
//move to destinition folder
document.move(yearFolder );

Hi @kaynezhang ,

i have datetime property as "giSmiley TongueolicyEndDate":"2013-11-28T22:25:51Z",  in that  i want only year that is 2013 as my folder. Could you guide me please.

Thanks,

Piyush.

hi, 

Can anyone suggest me how can i get year from this datetime property of "gi : policyEndDate": "2013-11-28T22:25:51Z". 

I am not getting it how to get this year value from the above property and i need to deliver this task as soon as possible.

Please someone do guide me out.

Thanks,

Piyush

hi @kaynezhang , @kintu_barot ,

can anyone guide me on the above property issue. I am stuck on this and is not finding solution anywhere.

Thanks,

Piyush.

kaynezhang
World-Class Innovator
World-Class Innovator

var date = new Date('2013-11-28T22:25:51Z')
console.log(date.getFullYear());