Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to link to a folder path with variable username

Posted on 2016-09-07
2
Medium Priority
?
140 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 2000 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 19

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

670 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