URL in UI Action

joshehren
Kilo Expert

Hello.   I'm having trouble adding a URL in a UI Action.   I've followed the instructions exactly as posted here: UI Actions - ServiceNow Wiki, but the link just goes to an empty SN page.

Here is my UI Action:

find_real_file.png

What am I missing?

Thanks in advance,

josh

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Josh,



Try adding logs in the ui action to determine if it is getting executed or not.


If that is not working you can also achieve the same in client side. Check the client box , give function name as openWindow();



in script add following line of code



function openWindow(){


window.open('www.google.com','_blank');


}



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Josh,



Try adding logs in the ui action to determine if it is getting executed or not.


If that is not working you can also achieve the same in client side. Check the client box , give function name as openWindow();



in script add following line of code



function openWindow(){


window.open('www.google.com','_blank');


}



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

That helped, Ankur.   I neglected to add the function to the Onclick section.   Having done that, it works just fine.


Ankur Bawiskar
Tera Patron
Tera Patron

Hi Josh,



Try using this URL "http://www.google.com" since https is not valid for google.com in your existing UI action.


If that works then great or else use the other approach suggested.



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks for your reply, Ankur.   I added logging, and the ui action is running.



I then changed the UI action so it looks like this:


find_real_file.png



But it still doesn't work.   It now opens up a ServiceNow window within the ServiceNow window.



Thanks,


josh