Skip to main content

Notifications

Create Folder in NetDocuments when Document is Uploaded to SharePoint Library

My Flow takes into consideration that you have installed on-premises data gateways for Microsoft Flow.

Follow https://docs.microsoft.com/en-us/flow/gateway-reference for more details.

Microsoft flow 

Step 1: Trigger : When a file is created in a folder. Where /FinalDocuments is the name of the SharePoint Document Library.

1.PNG

Step 2: Delay ( Just in case )2.PNG

Step 3:  Get file metadata                                             4.PNG

Step 4 : Get item ( where ItemId is from previous step)5.PNGRequirement was to create Folder name in netdocuments with ClientName-CurrentYear. Where ClientName is the Column in SharePoint.

Step 5: Compose Action 

FormatDateTime Formula - formatDateTime(utcNow(),'yyyy')

6.PNG

Create Folder in netdocuments is a premium connector available. Please check your licensing before utilizing this Connector.

 Step 6 : Create folder 

Every workspace under netdocuments have a Parent ID associated.7.PNG

In order to perform query without caring about the namespace, you can use local-name().

Following article helped me with this 

https://powerusers.microsoft.com/t5/Building-Flows/Using-xPath-on-an-HTTP-xml-body/td-p/73531

Step 7 : Compose Action8.PNG

Step 8 : We need to get ID from the XML. 

Formula Used: 

xpath(xml(outputs('XML')),'string(//*[local-name()="ndProfile.DocumentInformation"]/*[local-name()="standardAttributes"]/*[local-name()="id"]/text())')

1.PNG

Step 9 : Create document in Netdocuments where Destination is the output of Compose 2 Action which would give us the Destination ID.

2.PNG

Save the Flow and run. If it is a success it should create a folder in Netdocuments and move document uploaded in SharePoint document library to that folder. 

Thanks for reading!

Comments

*This post is locked for comments