How to load an existing form (example incident form) in a widget/page in a serviceportal

joanmarisse
Tera Expert

Hello,

Good day.

I would like to ask on   how to load/display an existing form (ex. incident form) in a widget /page in servicePortal?

Thanks!

1 ACCEPTED SOLUTION

vegardep
Giga Contributor

To add a form widget as a link on the service portal homepage:



Service Portal -> Pages -> find the page called Index, open the record and chose "Page in designer" in the related links section.


From the page designer, drag & drop an "Icon link" widget onto the page. Once dropped, press the pencil icon (top right corner) of the newly added "Icon link" widget. Set an apropriate title and set the Type field to URL and the HREF/URL field (pops up after you choose URL) to e.g.:


sp?id=form&table=incident&sys_id=-1



id is the name of the widget, table is the table you want to display the form from and -1 means new record



Or just open directly by URL:



yourinstance.service-now.com/sp?id=form&table=incident&sys_id=-1



If you want to edit the widget you have to clone it first and give it an appropriate name. The name you give it goes in the id= variable of the URL.


View solution in original post

11 REPLIES 11

JonathanJacob
Mega Sage

Try the following;



HTML


<widget id="widget-form" options='data.formWidget'></widget>


Server Script


data.formWidget = { table: "incident", sys_id: "-1", hideRelatedLists: false };



Also see this GitHub URL for more on Service Portal:


GitHub - service-portal/documentation: Here you will find unofficial documentation for the ServiceNo...


Hello Sir,



Please advise to where do I put the html and server script?



Thanks!


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Joan,



There's already a form widget you can use oob as well as an existing page you can use. The form page is just called form and you can pass it a table name and sys_id. For example, if you wanted to show a specific incident you would use the following:



instance.service-now.com/sp?id=form&table=incident&sys_id=j4h2k5lj34h5lkj234h5klj23h45kljh


Hi sir,


Please advise what do you mean by using form widget?


I have tried putting a form widget in my page but there is no input for a table.



Please advise.



Thanks!