- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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:
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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
👉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).
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 👇
Hope this helps!
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it helpful & accept the solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader