- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 09:15 AM
Hi,
On the Approval Form, when the approval manager opens a record and click on Description it gives the details of all the Variables coming from RITM record. But our client want to display only filled variable but not empty variables is it possible ?
As shown in the image we want to display only short description since it contains information but the description variable is empty so we dont want to display that.
Please help me how to fix this
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2020 10:34 AM
Very weird and I can only presume an Orlando bug?
I resolved this issue on your instance by storing the value and doing a comparison to null
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate jelly="true">
var set = new GlideappVariablePoolQuestionSet();
if (!JSUtil.nil(jelly.jvar_sc_req_item))
set.setRequestID(jelly.jvar_sc_req_item);
if (!JSUtil.nil(jelly.jvar_sc_task))
set.setTaskID(jelly.jvar_sc_task);
set.load();
</g:evaluate>
<table cellspacing="0" cellpadding="0" width="100%" data-sn-macro-sys-id="${jvar_macro_sys_id}">
<j:forEach var="jvar_question" items="${set.getFlatQuestions()}">
<j:if test="${jvar_question.isVisibleSummary()}">
<j:set var="jvar_valuekma" value="${jvar_question.getDisplayValue()}"/>
<j:if test="${jvar_valuekma != ''}">
<g:summarize_question question="${jvar_question}" />
</j:if>
</j:if>
</j:forEach>
</table>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 09:40 AM
you will have to customize the approval summarizer UI macro
I would recommend not to touch that as it is OOB
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 09:43 AM
you will have to create your own custom summarizer
refer link below
Create a new custom approval summarizer
refer my blog on custom summarizer for sysapproval_group table; something similar you can do for sysapproval_approver table
Approval Summarizer for Group Approvals
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 09:47 AM
Hi Shaik,
This is an approval summariser (OOB UI Macro approval_summarizer_sc_req_item). This in turn calls the approval_variable_summary macro.
This has a if statement to only include variables where the option "is visible on summary". You could add another if statement to only proceed with calling the summarize_question macro if the question has a value.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate jelly="true">
var set = new GlideappVariablePoolQuestionSet();
if (!JSUtil.nil(jelly.jvar_sc_req_item))
set.setRequestID(jelly.jvar_sc_req_item);
if (!JSUtil.nil(jelly.jvar_sc_task))
set.setTaskID(jelly.jvar_sc_task);
set.load();
</g:evaluate>
<table cellspacing="0" cellpadding="0" width="100%" data-sn-macro-sys-id="${jvar_macro_sys_id}">
<j:forEach var="jvar_question" items="${set.getFlatQuestions()}">
<j:if test="${jvar_question.isVisibleSummary()}">
<j:if test="${jvar_question.getDisplayValue()}"> <!--Added to remove null vars-->
<g:summarize_question question="${jvar_question}" />
</j:if> <!--Added to remove null vars-->
</j:if>
</j:forEach>
</table>
</j:jelly>
Before Modification:
After Modification:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 01:58 PM
Thank you for the reply. I did pasted your code in my approval_variable_summary UI Macro. But which is making the entire formatter as empty
Previous: If you see Short Description contains information but Description is empty
After, adding your code it is empty. Am i making any mistake ?
I just copy pasted your code