Link SharePoint List to a Document Library

SharePoint Lists are great for tracking activities. There are many scenarios where you may want to store a collection of documents for each List item. In this blog I explain how to use Column formatting to create the link to the documents related to a List item.

In this example, we have a List that will track enquires and a Library with a folder per enquiry. Each enquiry will have a unique number and the library will contain a folder with the same number. to keep it simple, I will use the Lists ‘Title’ field, but you could use a different value by adding a number generator or entering a unique value in the List form.


Create a List with the various fields you want e.g. details of the enquiry, type of enquiry, dates etc.

Create a PowerAutomate Workflow that creates a folder in the Document Library when a new item is added to the List. In this example, when an Item is created in “MyList”, the second step creates a folder in the “Clients” Library using the List items Title as the Folder name.

To create a hyperlink from a SharePoint List to the corresponding folder in a Document Library, follow these steps:

  • Add the following JSON column formatting to the column, replacing URL in the “href” line with your URL (Library URL)
  "$schema": "",
  "elmType": "a",
  "txtContent": "@currentField",
  "attributes": {
    "target": "_blank",
    "href": "='' + @currentField"

Done! Now every time a new List item is created, Power Automate will create a folder using the List items Title as the folder name. The calculated column will contain a hyperlink, that takes you to the corresponding folder where you will see existing documents and can drag and drop other correspondence.

Creating an item in the SharePoint List for Joe Bloggs, creates a Hyperlink

Clicking the Link takes me to the Clients document library with a list of documents for the client.

I use this technique for various scenarios including, customer enquires, client folders, incident management and certification tracking.

I hope you find this helpful.

9 thoughts on “Link SharePoint List to a Document Library

  1. this worked perfectly, however for me the link in the list does not actually take me directly inside the corresponding folder, it just brings me to the document library itself. Is there a way to have the link bring me inside the correct folder?

  2. Hi Mary, the value in the List needs to be the name of the folder e.g. if the folder is called 12345 then the List needs to have the same value. The JSON formatting will append the value to the end of the URL. I hope that helps.

    1. I realized it was actually my URL that was the issue and it works now thank you. This was actually the most straightforward way to accomplish this task, after hours of attempting various methods that all ended in failure. The only thing I did not consider is that if I need to change the title of the list item for some reason, the folder name does not update automatically to match.

      1. Thanks for the update Mary, I am glad you resolved the issue. You are right about the title, in some scenarios you can use a different column to store the folder value. That works as long as the value is unique.

      2. Hi Mary, facing the same problem – could you tell me how you realized it was actually your URL? The values in my list are identical to the name of the folder I want to link to, yet the link doesn’t take me inside the corresponding folder.

        Many thanks in advance for your help!

      3. The URL is made up of the URL for the library + folder name
        In the JSON, I use append the folder name to the URL using the value in the column the formatting is applied to. So you need to check two things:
        – Is the value in the column the folder name
        – If the Document Library URL correct –

        You can test by manually creating the URL and pasting into the URL bar. If that doesn’t take you to the folder then the URL is incorrect

    2. Is there a way to use JSON to derive the subfolder name (than hardcode it)? I have lots of sub folders and documents can move between the subfolders. I also need to use that path in a lookup field, possible? Prefer not to powerautomate.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s