The CreatorCon Call for Content is officially open! Get started here.

Is it possible to add a button to the details form in SOW for an Incident?

gsimoes
Tera Contributor

Is there a way to add a button to the Details Form for an incident?  I'm mainly curious re: SOW, but it's fine if it shows up on the form in the portal also. When I go into Form Builder, the only options for components are annotations and sections. I'm wondering if there's something I can create/add in order to add a button like the blue item in this picture:

gsimoes_0-1759163834705.png

I've already setup UI actions and had this function from related links and also from the action bar, I was hoping to have it more intuitively located on the form (and also more "restricted" in terms of visibility to the details section, so I was wondering if this is possible.  Thanks

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@gsimoes 

Not possible to add button within form.

If you go with UI actions then those will come on top in SOW always.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

M Iftikhar
Tera Sage

 

Great question!
I also got same confusion first time but don’t worry, it’s super easy to test 😁

 First go to Navbar Search for  UI Actions

MIftikhar_0-1759325605722.png

 


👉Then click New

Now just fill these things step by step:

  • Name → write Employee Button (whatever you wanna name your button)

  • Table → select e.g: Employee Onboarding (whatever table you are working on)

  • Order → keep 100

  • Active → tick it

  • Show insert → tick it

  • Show update → tick it

  • In the options, select Form button (this will show button under the form fields).

    MIftikhar_1-1759325695277.png

     

Now scroll down to the Script field and paste this small code:

 

(function executeAction(current, gForm) {
    // client side alert
    alert("Employee Button clicked successfully!");

    // server side info message (page reload pe dikhega)
    gs.addInfoMessage("Employee Button executed on Employee Onboarding record");
})(current, gForm);
 

That’s it! 🙌

After saving, go open any record from your  table.
Now you will see your Button
When you click → you get an alert popup, and also one info message will show after refresh.
After saving, I opened Employee Onboarding record and now you can see my Employee Button is showing 👇 

MIftikhar_2-1759325852261.png


Hope this helps!

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it helpful & accept the solution so others can benefit as well.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Hi Muhammad,

Thanks for that, but I've already done one of those. My question was if I could setup a button IN the form (not in the action bar at the top). So, for example: if I go to Form Builder, I can add in various record fields into the form that are not currently in there, so I was wondering if there is a way that I could add a button alongside or under one of those fields. Like the Form for Task has the Task Number field, would it be possible to put a button next to that field, similar to the "Preview Record" button that some fields have, but this button would call a different script include that I have.

Ankur Bawiskar
Tera Patron
Tera Patron

@gsimoes 

Not possible to add button within form.

If you go with UI actions then those will come on top in SOW always.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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