Solved

How to link to a folder path with variable username

Posted on 2016-09-07
2
104 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Greg Besso 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 17

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

735 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