Reducing the link size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 03:59 AM
I wanted to know about how to reduce the size of a link. I added a URL field to a form in ServiceNow and users can add any URL variable to it. But since URLs are lengthy, it occupies a larger chunk of the form. Is there any way where after user enters the URL and hits the lock button, the size of the URL gets reduced?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:06 AM
Hi @vrushabh_m
Request you please share some screenshot.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:09 AM
I am not supposed to share the screenshot as per the policy of the organization I work for, but as you can see how a link is automatically truncated when you enter it in microsoft teams chat, similarly I was hoping if there is a way to truncate the link that is entered in the URL field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:22 AM
Hi @vrushabh_m
not 100% sure, but have look here
https://www.servicenow.com/community/itsm-articles/how-to-shorten-servicenow-urls/ta-p/2310367
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 04:24 AM
you can try onLoad script like below. replace u_my_url_field_link with your field name.
function onLoad() {
var url = g_form.getValue("u_my_url_field");
if(url && url.length > 100) {
var short_url = url.substring(0, 100) + "...";
document.getElementById("change_request.u_my_url_field_link").innerHTML = short_url;
}
}
Please mark my answer correct and helpful if this works for you.