In this blog post I will out line how Power Automate can be used to create a folder in a SharePoint document library and then store the link to the newly created folder inside of Microsoft Lists. I have used this pattern numerous times for business processes where transactional metadata and document storage are required. For example, a case management list stores the business process data and the folder stores the supporting documents.
I am using a list called “Exchange Agreements” in this blog post. You can replicate this Exchange Agreements using the my spreadsheet (see below) and these instructions: Microsoft Lists: new list using an existing Excel spreadsheet
Let’s start by adding a new “Hyperlink” column to the Exchange Agreements list called “FolderLocation”.

Create a new Flow from by clicking “Automate” > “Power Automate” > “See your Flows”.

Create a new “Automated – from blank” Flow.

Provide a name for the Flow i.e. “Exchange Agreements – New”; select the “When an item is created” SharePoint trigger and then click “Create”.

Set the “Site Address” and “List Name” to you target site and list.

Click “New step”, search for “Variable” and select the “Initialize variable” action. Set the “Name” to “varFolderName” and “Type” to “String”.
“Value” should be set to something unique, readable and short. In my demo, I combine school name and exchange type for a value of “University of South Australia (Undergraduate Programs)”.

Power Automate expressions and the concat function work well in these situations. Here is the expression I use:
concat(triggerOutputs()?['body/Title'], ' (', triggerOutputs()?['body/ExchangeType/Value'], ')')

Click “New step”, search for “SharePoint” and select the “Create new folder” action.
Set the “Site Address”, “List or Library” to you target site and document library, and “Folder Path” to “varFolderName”.

At this point the folder has been created and now we have to update the list with the URL path to the folder.
Click “New step”, search for “SharePoint” and select the “Send an HTTP request to SharePoint” action.
Set the “Site Address” and “List Name” to you target site and list.

Also set:
- “Method” to “POST”
- “Uri” to “_api/web/lists/GetByTitle(‘Exchange‘)/items(ID)
- Where ‘Exchange’ is the list name and ID is the “ID” from the SharePoint “Create new folder” action
- “Headers” – switch to text – to:
{
“Content-Type”: “application/json;odata=verbose”,
“X-HTTP-Method”: “MERGE”,
“IF-MATCH”: “*”
} - “Body” to:
{‘_metadata’: {‘type’:’SP.Data.ExchangeListItem’},’FolderLocation‘: {‘Description’: ‘varFolderName‘, ‘Url’: ‘LinkToItem‘}
}- Where Exchange is the list name; FolderLocation is the column name; varFolderName is the variable and LinkToItem comes from the “Create new folder” action.
My completed Flow looks like the image below:

Save your Flow and test by submitting a new item to your list. If all goes well the new folder will be created and a link to the folder will be added to the list item.


This pattern can be beneficial for large volume lists and folders. The folder location URL serves as a simple pointer to the supporting documents and negates the need for the user to search or navigate to the folder.
Thanks for reading.
NY
Great Post Norm.
LikeLiked by 1 person
Great and valuable blog which will add huge business process benefits!
Question – off topic – if you have a Microsoft List created can you adjust power automate to send emails to line managers and customers so for example power automate can send a bulk email which includes 3 of 4 items in the list which require them to action?
At the moment I have setup power automate to send emails per individual item. Managers want 1 email alert not 3 or 4 emails per item on the list.
LikeLike
Hi Amardip,
Yes, you can set up a message with multiple items. The key to the solution is that the message body needs to be compiled before the send mail message action executes. This sounds like a great idea for a future blog post.
Thanks for reading!
Norm
LikeLike
Thanks Norm. Keep up the great work!
Amardip
LikeLike
Thanks, Amardip! This post was written with you in mind: https://normyoung.ca/2020/12/21/send-a-single-reminder-for-multiple-items-using-lists-and-power-automate/
LikeLike