cancel
Showing results for 
Search instead for 
Did you mean: 

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!

Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Cambridge UK Power Platform User Group Leader, Technical evangelist and speaker. Always says yes to coffee! #LetsGetCoffee
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • I am building business processes and applications that are easy for users' to stick to, so they can follow and understand them. In overall I transform processes to be more reliable and effortless. I am a proud co-organizer of SharePoint Saturday Warsaw and active community member, blogger and international speaker.