UIB Link to destination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2024 05:15 AM
Hello,
I'm looking for a way to script a "link to destination" action(in a list component), so that it points to a page in our service-now instance, but is not part of the "experience". The current problems I'm facing are:
- I cannot point to an external url when using a scripted handler. Instead I get a "Page doesn't exist".
- I cannot access the current instance name inside the script, so that I can build the proper url. I tried using the window object, but it is not defined even though that the script seems to be executed on the client, since my console.log works.
The reason I'm using a script is that we need to create a dynamic url, but don't want to use an "experience" page.
Example code:
/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
*/
function evaluateEvent({
api,
event
}) {
if (event.payload.table && event.payload.table === 'incident') {
return {
route: `https://www.google.com`,
fields: null,
params: null,
redirect: null,
passiveNavigation: null,
title: null,
multiInstField: null,
targetRoute: null,
external: true,
navigationOptions: null
};
}
return {
route: null,
fields: null,
params: null,
redirect: null,
passiveNavigation: null,
title: null,
multiInstField: null,
targetRoute: null,
external: null,
navigationOptions: null
};
}
Instance version: Vancouver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2025 01:35 AM
Glad I was able to be helpful! Here are some useful links to start digging into this topic: