- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 03:57 AM
Hello.
I'm developing a Portal Experience within UI Builder and I have a Repeater component that will show a brief info of some catalog items and have 2 stylized texts and a button to link to the portal. Both text components get the info from @item.value....
But when it comes to the button event handler, I need to link to an external url. I don't know how to grab the sys_id that comes from the data resource within the code.
I would like to have something like this:
function evaluateEvent({api, event}) {
return {
route: null,
fields: null,
params: null,
redirect: null,
passiveNavigation: null,
title: null,
multiInstField: null,
targetRoute: null,
external: {
url: "/esc?id=sc_cat_item&sys_id=" + @item.value.sys_id.value
}
};
}
Is this possible or there is a better way to do this ?
I know I could also have a Text Link component but I would prefer to have the buttons.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 04:14 AM - edited 01-11-2023 04:37 AM
Hi @edgarbasto,
Best way is to use the debugger in your script. And open browser console. Once you have clicked on button, it will show all the event and api data.
to access item object use the api:
return {
route: null,
fields: null,
params: null,
redirect: null,
passiveNavigation: null,
title: null,
multiInstField: null,
targetRoute: null,
external: {
url: `esc?id=sc_cat_item&sys_id=${api.item.value._row_data.uniqueValue}`
}
Let me know if it helped.
Thanks
Nootan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 04:14 AM - edited 01-11-2023 04:37 AM
Hi @edgarbasto,
Best way is to use the debugger in your script. And open browser console. Once you have clicked on button, it will show all the event and api data.
to access item object use the api:
return {
route: null,
fields: null,
params: null,
redirect: null,
passiveNavigation: null,
title: null,
multiInstField: null,
targetRoute: null,
external: {
url: `esc?id=sc_cat_item&sys_id=${api.item.value._row_data.uniqueValue}`
}
Let me know if it helped.
Thanks
Nootan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2023 05:43 AM
Didn't know about the
debugger;
Thank you. This helped a lot and fixed it.
Best regards,