How do I get the path of where a file is saved to show as a column in Sharepoint?

JRader 25 Reputation points
2024-08-16T15:23:32.3466667+00:00

If I want to find the location where a file is saved in sharepoint, I have to select the 3 dots to the right of the file name, select Details, and scroll to the very bottom of the side menu to see the path. Is there any way to add a column that will automatically show that path, similar to how you can see when the file was created or modified?

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,325 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emily Du-MSFT 50,411 Reputation points Microsoft Vendor
    2024-08-19T07:01:41.7266667+00:00

    Here is a workaround, create a single line of text column and use following JSON codes to show file path.

    Select the column -> Column settings -> Format the column -> Advanced mode -> Use codes.

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "='https://tenant.sharepoint.com'+[$FileRef]"
    }
    

    enter image description here


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Jek 0 Reputation points
    2025-02-21T16:09:26.3466667+00:00

    User's image

    After you create a new column, you need to go to Column settings, then Format this column, where you can find the Advance option to can paste the JSON

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.