Link to home
Start Free TrialLog in
Avatar of Seven0fNine
Seven0fNine

asked on

Help with using an Internal URL in SharePoint column with out the https:// being present

Hi, any help with this enigma! would be much appreciated. I am using SharePoint 2016 on-prem,,,,,

ISSUE:
I have created a new SharePoint list and would like to use an an internal URL in a SharePoint hyperlink column control. The Internal URL loads a client-side program. Unfortunately, the hyperlink control insists on the https:// to be present. The internal URL does not require http:// or https://.  See image of the internal URL .

User generated image
I have tried using a new 'single line of text' column and the Edit Source option to add a <a href> tag to create a hyperlink for the internal URL and some javascript. Again, SharePoint strips out the code leaving a dud hyperlink.

Is there a column / setting that allows a URL without the https:// OR is there a way of using the SharePoint hyperlink column initially with the https:// and then (via code) when the hyperlink is clicked on the https:// is ignored / removed and the Internal URL is just read?

Thanks in advance.
Avatar of Walter Curtis
Walter Curtis
Flag of United States of America image

Just a quick idea, may not work. Use a Multiple line of text column and use the RTF style of box, not the plain text box. You may be able to use the link you want from that column type.

Let me know if that helps...
Avatar of Seven0fNine
Seven0fNine

ASKER

Thanks for your suggestion, tried that  with rtf format and html code and still no luck. The hyperlink works in when in Edit mode, but as soon as the column is saved  - SharePoint strips out the code leading a dud hyperlink.

That said, looking at this quandary from a different perspective with SharePoint striping out what is sees is 'dangerous' code, can this validation be 'switched off' ?. SharePoint is only being used for my companies Intranet.
You can use a calculated column to render HTML correctly. You will probably have to 'allow' HTML markup in the web app. This article shows how to do this. It worked, I did it in my farm.

https://social.technet.microsoft.com/wiki/contents/articles/40146.sharepoint-online20162013-html-rendering-in-calculated-columns.aspx

https://support.office.com/en-us/article/handling-html-markup-in-sharepoint-calculated-fields-a3db28e4-747c-437e-b085-8f795b722a8c?ui=en-US&rs=en-US&ad=US

One thing these article may not mention, you will need to set the calculated column as a 'number' type. Here is an example of the formula I entered in the calculated column which includes HTML code.:

=IF(([Percent Free]>DiskThreshold),"<DIV style='font-weight:bold;font-size:14px;color:green'>"&(ROUND([Percent Free]*100,1)&"%</DIV>"),"<DIV style='font-weight:bold;font-size:14px;color:red'>Warning! "&(ROUND([Percent Free]*100,1)&"%</DIV>"))

Open in new window


Hope that helps...
ASKER CERTIFIED SOLUTION
Avatar of Seven0fNine
Seven0fNine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad it's working for you. Thanks for the thanks!
Thanks for the thanks thanks !!