Solved

How to link to a folder path with variable username

Posted on 2016-09-07
2
60 Views
Last Modified: 2016-09-08
Is it possible to create a hyperlink with %USERNAME% in the file path on Sharepoint?

I want to create a link to this folder:
C:\Users\%USERNAME%\AppData\Roaming\

but when I click on the hyperlink nothing happens. I can successfully make hyperlinks to folder paths without the %USERNAME%

Looking at the path it is trying to access the "%" part seems to turn into "%25"
I have tried "%%" but then I get "%25%25"

Thanks
0
Comment
Question by:GDAhern
2 Comments
 
LVL 15

Accepted Solution

by:
whoajack earned 500 total points
ID: 41787725
Hey there,

It's a bit foggy for me at the moment, but one way I'm thinking is if you use the Javascript API to read/write to your SharePoint list to update your URL column (if i'm reading the question correctly) you can accomplish this. There might be a better way too but wanted to chime in in case you find this useful.

My reminder blog post about a general example using the JavaScript API for SharePoint (where you can simply put a text file in a document library and then refer to it in a web part on the view page) is here:
https://gregbesso.wordpress.com/sharepoint/javascript-api-readwrite/

Another post I just found online specifically mentioning how to get the userID is here:
http://stackoverflow.com/questions/20981226/sharepoint-2013-get-current-user-using-javascript

Hope it helps, sorry if I misunderstood your actual goal.
0
 
LVL 14

Expert Comment

by:SneekCo
ID: 41788253
Are you just using the "Insert a Link" from the ribbon?

In most cases it is not possible. A link, even to the file system is an html tag and variable as you describe are not support. Using some above information for the post above (which is really good), you should be able to use Javascript of jQuery to determine the user name and then use it in the link.

Good luck...
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now