Approvel Summarizer with Multiple Sections.
What is Approvel Summarizer:-
The summary at the bottom of an approval form is called Approval Summarizer. It is created by the approval summarizer formatter. The approval summarizer displays different information depending on what’s being approved (such as a change request or a service catalog request). By default, the approval summarizer form contains only one section. We can customize this form to display multiple sections with different information using UI macros. The following information provides how to create a approval summarizer form with multiple sections.
An Approval form is invoked when the workflow triggers. When approval form invokes approver receives a mail with ServiceNow URL, This URL displays Activities and Approval Summarizer. Approval Summarizer is a summary of requested items. Approver can view only one section in approval summarizer , To view multiple sections in summary It is possible with Approval Form Design and Ui macros. In Approval Form design Create multiple views.
Creating Multiple Views in Approval Form Design
To create a new View, from the left navigation pane,
select Service Desk- > My Approvals ->Approval->Configure->Form Design.
- We can create different views for webforms as shown in the below screens.
2. In Form Design select appropriate table from the list and select New from view list
3. In Create new view window give a view name and click ok. Created new view is display under View List. Select view and give a section name with fields and save the form.
Create multiple views with the same process and give different sections and fields for each view. Use these views in Ui macro Xml field which contains jelly Script
By Using these views create a Ui macro
Creating UI Macros:-
The Approver Summarizer takes the details from approver summarizer default UI macro. If Approver wants to see more information in the summary of requested items then we have to create a new UI macro.
Approval summarizers are stored in the Macro [sys_ui_macro] table. To create a new macro, from the left navigation pane, select System UI > UI Macros. Summarizers use a naming convention of approval_summarizer_ + ‘<table_name>.
Name: A unique and descriptive name for the macro. Name must be followed by table name.
Active: Select the check box to render the element as defined. Clear the check box to disable the element without deleting the code.
Description: Describe the purpose of the macro and parameters passed to it.
XML: Jelly script that defines the macro.
Each summarizer is written in Jelly script, which is used by ServiceNow to define internal forms. The script is stored in XML field at the bottom of the UI Macro form. In the below Script used different views which Contains Different forms. Using this we can display number of items under Summary.
On clicking this Link we can see a part of the script which consists of different Views like My_View, Plan 1, and Plan 2 which are custom defined views for web forms.
Below Screen shows Approval Summarizer with multiple Sections.