- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 04:47 AM
Hello All,
I am trying to retrieve our instance URL in the UI Builder and am I have been unable to accomplish this.
The reason why I am trying to do this is we have a button on our workspace home page that links to our service portal, however this needs to be updated manually when we push any changes up through test then production.
I have tried to do this via a script but the traditional methods that I know about have not worked.
Any suggestions would be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 06:12 AM
Hi @BriTaylor,
Go to table sys_ux_data_broker_transform, create a new one.
Add the below script.
function transform(input){return gs.getProperty('instance_name');}
Now come back to UI Builder, refresh the page. Now add the new data resource created and make sure you create the execute ACL for the data broker otherwise you'll get error for the same.
Now create a page script.. add the below script.
const instanceName = api.data.get_instance_name_1.output;//replace get_instance_name_1 with your data resource id.
console.log(instanceName);//output will be "devXXXXX" for PDIs
Now go to events section of the created data resource and click on Add event mapping & add the page script under Data fetch Succeeded event.
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 06:12 AM
Hi @BriTaylor,
Go to table sys_ux_data_broker_transform, create a new one.
Add the below script.
function transform(input){return gs.getProperty('instance_name');}
Now come back to UI Builder, refresh the page. Now add the new data resource created and make sure you create the execute ACL for the data broker otherwise you'll get error for the same.
Now create a page script.. add the below script.
const instanceName = api.data.get_instance_name_1.output;//replace get_instance_name_1 with your data resource id.
console.log(instanceName);//output will be "devXXXXX" for PDIs
Now go to events section of the created data resource and click on Add event mapping & add the page script under Data fetch Succeeded event.
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 05:32 AM
Hi,
One solution will be, albeit I hope we can come up with a simpler one,
Create a data broker(sys_ux_data_broker_transform)
Add script:
function transform(input) {
return (gs.getProperty('instance_name'));
}
Add an ACL with the sys_id for that databroker you just created, something like this:
Call this data broker in your ui builder.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 01:56 PM
FYI, in the Washington release, we now have an out of the box data resource "Look Up Properties"