How does Form Widget determine what view to use?

gaf627
Tera Expert

I'm using the form widget to display a form depending on the type of record selected (incident, requested item, demand, etc.) from an open records page.  How does the form widget determine which view to use?

Examples:

  1. Logged into Service Portal as a user with no role (ess user). Select an open incident. The form widget displays the Self Service view, as I would expect.
  2. Logged into Service Portal as a user with itil role.   Select an open incident. The form widget displays the Service Portal view.  I expected it to display the Default view, which is what is displayed when I log into the backend.

Thanks!

1 ACCEPTED SOLUTION

ChrisBurks
Mega Sage

The form widget looks for the parameter "view" or "v" on the url or as an option from the option schema. 

URL example: <instnace_name>.service-now.com/sp?id=form&table=sc_req_item&sys_id=<record_sys_id>&view=<name_of_view>  

If a view name is not given in the url or the option, I believe it will default to "sp" (service portal). If a "Service Portal" view isn't found then depending on roles it will default to "Default" view or the view the user is allowed to see.

 

 

View solution in original post

7 REPLIES 7

shawna
Tera Guru

can't you specify in the "view" parameter of the URL?

e.g. for incident to use portal view:

https://example.service-now.com/sp?id=form&table=incident&sys_id=1c741bd70b2322007518478d83673af3&view=portal

 

 

ChrisBurks
Mega Sage

The form widget looks for the parameter "view" or "v" on the url or as an option from the option schema. 

URL example: <instnace_name>.service-now.com/sp?id=form&table=sc_req_item&sys_id=<record_sys_id>&view=<name_of_view>  

If a view name is not given in the url or the option, I believe it will default to "sp" (service portal). If a "Service Portal" view isn't found then depending on roles it will default to "Default" view or the view the user is allowed to see.

 

 

gaf627
Tera Expert

Chris,

Thanks! That helps, and is exactly what I'm experiencing.  View is defaulting to "sp", but displays self service view because sp is not available.  I didn't see an option on the option schema to set the view.  Is there someplace that I can do so?

Thanks again!

shawna
Tera Guru

View is passed as a URL parameter show as Below. So you will set in the actually URL  that links to the page containing the form widget. It is not in the URL field of instance or the widget option. 

find_real_file.png