Solved

How to link to a folder path with variable username

Posted on 2016-09-07
2
86 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 16

Expert Comment

by:Walter Curtis
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sharepoint List View 6 34
Set cookies HttpOnly and Secure 4 169
Initialize SharePoint Online List Values in Quick Edit 7 37
SP2010 Parent Child Relationship 3 36
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…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

825 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