Skip to main content

We have “Labels” in our service catalogs that are links to documents in SharePoint that we want people to access and fill out. This results in them being over 200 characters long. Our implementation team made this work somehow by showing this (for example)

Click here <a target="_blank" href="https://our.sharepoint.com/:x:/r/sites/OurITServiceManagement/Shared%20Documents/General/Document%">Some Accounting Form</a>

Which points to this:

https://our.sharepoint.com/:x:/r/sites/OurITServiceManagement/Shared%20Documents/General/Document%20Repository/Some%20Accounting%20SR%20-%20Manual%20Final%20Form.xlsx?d=w99bc75c8a6054fa08fc84f4a5887ce9e&csf=1&web=1&e=k52h4R

Has anyone else solved for this?  A table or code for instance?

 

We worked with a member of the implementation team and learned how to do this vis JS by going to the catalog in question then ‘scripting’. In our example it would look something like this:

Script for Links more than 200 characters:

$(document).ready(function(){
  // Get the elements by their IDs
var element1 = document.getElementById('BodyContentPlaceHolder_lbl_1688_415');
 
// Create anchor tags with URLs and text for each element
var anchorTag1 = document.createElement('a');
anchorTag1.href = 'put your link here';
 
// Replace with the desired URL for element1
anchorTag1.textContent = 'Click here: Cost Center Codes';
  anchorTag1.target = '_blank'; // Open in new tab
 
// Clear the existing content of the elements
element1.innerHTML = '';
 
// Append the anchor tags to the elements
element1.appendChild(anchorTag1);
});


Reply