How to add dynamic URL in instance with URL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16 hours ago
I have a requirement to change URL dynamically or based on condition on widget in sp_instance_link HREF/URL. How to handle this or is there any way to do this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
43m ago
Hi
It is possible to create a custom portal page and a custom widget, then update the HREF to use the sp_instance_link
Below is an example demonstrating how to configure a dynamic URL for both admin and non-admin users.
1. Create a new portal page redirect_menu_url
2. Create a custom widget and add it to redirect_menu_url page
Add below code to the server script
3. Create a system property portal.menu.links
Value : {
"get_help": "{'admin':'https://www.google.com/','non-admin':'https://www.youtube.com/'}"
}
This setup enables dynamic redirection from a portal page based on both the provided key in the URL and the user's role (admin or non-admin). The widget script retrieves the proper destination link from the system property and assigns it to data.targetUrl for use in navigation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
38m ago
what's your business requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
