Hello everybody, sorry for the long absence but I was on vacation. Here we are again with a short but easy to use tip for Flow users who work a lot with SharePoint. This tip will make your flow a lot shorter, because you don’t have to copy all the steps. The simple answer to this problem will be explained in this blogpost.

The Problem

We are asked to add 10 folders to a document library on a SharePoint site. You can use this tip for one-time use to adjust a SharePoint site, but you can also automate this to apply it to multiple sites.

The Solution

First, create a list of all folders who needs to be provided in the document library. We do this by using the action ‘Initialize variable’.

Then we provide a loop that will cover all the elements in the list. For each element a folder will be provided. Instead of the black square, you place the name of the document library. The flow will create the different folders in this location using the ‘Current Item’ which is given as ServerRelativeUrl in the Body of the POST HTTP request.

The Code in the Uri:

_api/Web/GetFolderByServerRelativeUrl(‘YourLocationName/’)/folders

The Code in the Body:

{
“__metadata”: { “type”: ‘SP.Folder’ },
‘ServerRelativeUrl’:’@{items(‘Apply_to_each’)}’
}

Now Flow will take care of the several folders in the document library. This was again a short tip but no less handy! Next week there will be a new blog post, stay tuned…