How to add dynamic URL in instance with URL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks 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
3 weeks 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
3 weeks ago
Actually my requirement is to use existing page but functionality wise i need to add filter part appended in url
For Example: if i add csm?id=csm_my_lists&table=sn_customerservice_case&target_page_id=csm_ticket in HREF url when widget loads filter = something need to appended on initial load
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
what's your business requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I’m using sp_instance_link for icon redirection in a Service Portal widget. The current URL looks like this:
?id=csm&table={table_name}&view={view}I need to modify this URL dynamically based on certain conditions by appending a filter, for example:
?id=csm&table={table_name}&view={view}&filter={some_condition}What’s the best way to achieve this?
- Can it be done on the client side or server side within the widget?
- Or is there a way to handle this directly in the instance link configuration?