Skip to main content

Notifications

Extract target file link from the shortcut link (.url) in SharePoint library

Use Case:

To get or extract the actual file link from the shortcut link (.url) present in the SharePoint library.

ManishSolanki_0-1717327713235.png

Solution:

In this example, we are extracting the link on creation or addition of a file so I have used an automated trigger "When a file is created (properties only)" but you may choose the trigger as per your need.

 

Choose SharePoint site URL & library name in the input parameters:

ManishSolanki_1-1717328083835.png

 

Add "Get file content" action. Pass the file identifier dynamically from the output of trigger:

ManishSolanki_2-1717328230183.png

 

Finally add a "Compose" action to get the actual link of a file. We will enter an expression to get the value of required link. Expression needs to be added in the Function box as shown below:

ManishSolanki_3-1717328582338.png

trim(last(split(decodeBase64(body('Get_file_content')?['$content']),'URL=')))

The output of compose action will give the actual link of shortcut link(.url).

 

Output:

ManishSolanki_4-1717328755187.png

 

Conclusion:

We can extract the actual link of a file from SharePoint library by decoding the base64 content of link object and parsing that decoded string using complex expression.

 

 

Comments

*This post is locked for comments