Solved

How to link to a folder path with variable username

Posted on 2016-09-07
2
76 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 15

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

23 Experts available now in Live!

Get 1:1 Help Now