Show UI Action Client in Service Portal Form Widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2022 05:08 PM
Hello, I would like to ask if there's a way to make UI action client callable appear in Service Portal Form Widget? The reason why I'm using a client callable UI action is to have a confirmation first before firing a server-side script.
My code is similar to this:
//Client-side 'onclick' function
function runClientCode(){
if( == false){
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), ''); //MUST call the 'Action name' set in this UI Action
}//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if(typeof window == 'undefined')
runBusRuleCode();
//Server-side function
function runBusRuleCode(){
current. = ;
current.update();
gs.addInfoMessage('You did it!');
action.setRedirectURL(current);
}
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2022 06:09 PM
Hello Gab,
From a snow point of view, UI Actions marked Client is not compatible with Service Portal and will be ignored by the Form widget. For the workaround, you can create a custom action button via customizing the form widget for the particular use case.
A similar kind of use case has been explained in the below article -
Client and Server Side Buttons
Mark it as helpful or correct, If Applicable
Cheers..!
Happy Learning:)
Tushar
Cheers..!
Happy Learning:)
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2022 06:46 PM
Hello Tushar,
Could you give me a simple example on how to do this with custom button widget?
I'm totally new on ServiceNow 🙂
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2022 09:01 PM
Hi,
client side UI actions are not supported on form widget.
You can use custom form button
check this out
Adding a custom button on a form widget
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader