1. What is a ServiceNow Service Portal?
Answer:
ServiceNow Service Portal provides a user-friendly interface for users to interact with the ServiceNow platform. It allows the creation of customized web portals where users can access various services like submitting incidents, requests, and approvals. It is built using AngularJS, Bootstrap, and other modern web technologies, making it more dynamic and responsive.
2. What is the difference between ServiceNow CMS and Service Portal?
Answer:
- CMS (Content Management System) is the older framework used to create user interfaces in ServiceNow. It relies on a less flexible and less modern architecture.
- Service Portal, on the other hand, is a newer, more flexible framework that leverages AngularJS, Bootstrap, and other modern technologies, making it more dynamic and responsive, providing better performance, customization, and a mobile-first approach.
3. What are Widgets in Service Portal?
Answer:
Widgets are reusable components that are the building blocks of a ServiceNow Service Portal page. They are used to display data, interact with users, and execute specific tasks. Each widget consists of:
- HTML Template (markup)
- CSS (for styling)
- Server-side script (data processing)
- Client-side script (for interactive actions)
4. How do you create a new page in Service Portal?
Answer:
- Go to the Service Portal > Pages.
- Click on "New" to create a new page.
- Fill in the page name, ID, and layout.
- Add widgets to the page by dragging and dropping widgets into containers.
- Save the page, and it will be available in your portal.
5. Can you explain how Service Portal uses AngularJS?
Answer:
Service Portal uses AngularJS as the client-side framework for creating dynamic and interactive web pages. Widgets in Service Portal often contain AngularJS controllers and directives that bind the HTML elements to data models. This helps in building responsive and fast applications where data binding happens automatically without needing to refresh the entire page.
6. How do you pass data between two widgets in the Service Portal?
Answer:
You can pass data between widgets using Event Broadcasting
. Service Portal supports AngularJS $broadcast
and $emit
methods to communicate between widgets:
- Use
$scope.$emit
in one widget to send an event. - Use
$scope.$on
in another widget to listen for that event.
7. What are the different types of Service Portal widgets?
Answer:
- Instance Widgets: Pre-built widgets that can be configured and reused in various pages.
- Custom Widgets: Widgets you build from scratch for specific requirements.
- Data Table Widgets: Used to display ServiceNow table records in a tabular format.
- Form Widgets: Used to display and submit forms.
8. How do you debug Service Portal issues?
Answer:
- Browser Developer Tools: Use the browser's developer tools to inspect elements, check network requests, and review console logs for errors.
- ServiceNow Scripts: Use server-side and client-side script logs to trace issues. Add
gs.log
for server-side logging andconsole.log
for client-side logging. - Angular Debugging: Check the AngularJS-specific issues using the browser's AngularJS inspector tools.
- Widget Editor: Use the inbuilt widget editor to test and debug individual widgets.
9. What are Portals, Themes, and Pages in Service Portal?
Answer:
- Portals: A portal represents a collection of pages, widgets, and themes that form a Service Portal website.
- Themes: Themes define the appearance of your Service Portal, including fonts, colors, and overall layout. You can create custom themes to match the branding requirements.
- Pages: Pages are individual screens or views in a Service Portal that contain various widgets and serve specific functions, such as submitting requests or viewing knowledge articles.
10. How do you customize the header and footer of a Service Portal?
Answer:
You can customize the header and footer of a Service Portal by:
- Navigating to Service Portal > Themes.
- Editing the theme that is applied to your portal.
- Modifying the header/footer HTML or selecting custom widgets for the header/footer sections of your portal.
11. How do you import a custom library like jQuery into a Service Portal?
Answer:
You can import external libraries by:
- Going to Service Portal > Portals.
- Selecting the portal where you want to add the library.
- Adding a link to the external library in the "CSS Includes" or "JS Includes" section of the portal properties.
12. How can you secure data in a Service Portal?
Answer:
To secure data in Service Portal, ensure that:
- Access Control Rules (ACLs) are set on the ServiceNow tables being accessed by the portal widgets.
- Business rules and Script Includes that retrieve data are written to enforce proper role checks.
- Avoid exposing sensitive data in the client-side scripts, as they are visible to users.
13. What is the role of a Script Include in a Service Portal?
Answer:
Script Includes allow you to write reusable server-side scripts in ServiceNow. In the Service Portal, Script Includes are often called from widgets to interact with server-side data, perform complex operations, or enforce security before returning data to the client-side.
14. How do you deploy a Service Portal into production?
Answer:
- Ensure all components (pages, widgets, themes) are ready and tested in a non-production environment.
- Use Update Sets to capture all the configurations related to the Service Portal.
- Move the Update Sets to the production instance and commit them.
- Perform thorough testing to ensure the portal functions correctly in production.
15. How do you use the Widget Editor in ServiceNow?
Answer:
The Widget Editor is used to create, edit, and test Service Portal widgets. You can access the Widget Editor by:
- Navigating to Service Portal > Widgets.
- Selecting an existing widget or clicking on "New" to create a custom widget.
- The editor provides tabs for server scripts, client scripts, HTML templates, and styles (CSS). You can make changes, preview the widget, and test it within the same interface.