Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

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

joanmarisse
Tera Expert

Hello,



Does anyone have an idea?


I would gladly appreciate it..


When you find out can you please update this thread, as I'll be needing an answer to this next week.   BTW did Jonathan's suggestion work?


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.


Hi Vegard,



I'm using Form Widget. I have 3 different forms which I want to display dynamically based on the Client Controller function I'm calling from HTML and passing a parameter to that function which determines which view/which table/which sys_id to load it from. I have troubles passing these parameters to the Form Widget. I tried to follow this post -



How to communicate between widgets in Service Portal



Tried below code but doesn't seem to display the form on the page -



var whichform_jsonstring = '[{"table":"' + table_name + '","sys_id":"' + curr_sysid + '","view":"' + view_name + '"}]';


$rootScope.$broadcast('spModel.uiActionComplete', whichform_jsonstring);



Can you guide me here please?



-Gauri


Victor Sutherl2
Kilo Contributor

Hi Joan,



Is there any way to have a custom app load in the same frame - i.e. Within the Service Portal "Container", as opposed to it redirecting to an entirely new window / page within the SN instance.



Many thanks,


Victor.