Open a URL in UI Builder

Steve Stivers1
Tera Contributor

I am working in Utah UI Builder and I need to open a new browser tab with a link to an attachment on a record. I can build the URL and it works in the Text Link component but the user has to click the link to open the new tab.

 

I need to open it without the user clicking the link. In my page script I have tried:

top.window.open('https://www.google.com','_blank') ;
g_navigation.openPopup(URL);
 
All of these fail. How can this be done?
1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You can use the link to destination event handler on the page ready event like this:

  1. Click the Body component on your UIB page in the left hand content tree.
  2. Click the Events tab in the configuration panel on the right.
  3. Click Add event mapping and choose Page ready
    BradTilton_0-1692219049290.png
  4. Choose Link to destination and Select destination
    BradTilton_1-1692219133036.png
  5. From here you can link to a workspace page in a new workspace tab or select external to open a page outside of workspace (like google)
    BradTilton_3-1692219222541.png
  6. Click OK and Add.

This would cause a new browser tab with google.com loaded on page load.

View solution in original post

9 REPLIES 9

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You can use the link to destination event handler on the page ready event like this:

  1. Click the Body component on your UIB page in the left hand content tree.
  2. Click the Events tab in the configuration panel on the right.
  3. Click Add event mapping and choose Page ready
    BradTilton_0-1692219049290.png
  4. Choose Link to destination and Select destination
    BradTilton_1-1692219133036.png
  5. From here you can link to a workspace page in a new workspace tab or select external to open a page outside of workspace (like google)
    BradTilton_3-1692219222541.png
  6. Click OK and Add.

This would cause a new browser tab with google.com loaded on page load.

Hi Brad,

 

Sorry to hijack this message but I also have a question regarding adding a URL.  In My UI Builder Dashboard I was looking to use the bottom component as a way to link to a URL.   However, like above I don't see the ability to add event Mapping for the button.  Is it not possible to use a button as a link to a URL?  If so, should I try adding the link a different way?

 

Thanks,

--Brian

I'm not sure what you mean by bottom component. Could you show a screenshot of the page in UIB with the component selected that doesn't have any events?

Sorry... My bad Typo.   Button Component.

Screenshot 2023-10-23 at 8.18.29 AM.png

 Trying to make these into URL buttons...

 

Screenshot 2023-10-27 at 12.23.57 PM.png