Work-around — Create folder in SharePoint library using Microsoft Flow

Thomas Granheim
2 min readJul 13, 2017

--

Recently I had a customer wanting to connect an sales opportunity to a set of documents in Office 365. Technically they wanted one folder per opportunity (SharePoint list) in a Document Library in SharePoint Online and have a reference to the folder in the list item.

Currently there are no actions for creating folders in SharePoint document libraries with Microsoft Flow. That doesn’t mean it’s not doable, so this is the Flow I created to make it work:

Steps:

  1. Trigger the flow when an item is created in the list.
  2. Create a temp.txt file in the desired document library and build the folder path dynamically based on the Title of the list item created in the action above.
  3. Create a variable FilePath for storing the file path in a variable.
  4. Create a variable FolderPath which replaces the the file name in FilePath with blank and leaves you with the folder path.
  5. Now update the list item with a reference to the folder (FolderPath) in the document library.
  6. Finally, delete the file created in the document library.

Basically when creating a file with a non-existing path, the path is created for you, and clean up the temp file used in the work-around.

Happy Flowing!

--

--