Need help on Approval Form Description

shaik_irfan
Tera Guru

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 ?

find_real_file.png

 

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 

1 ACCEPTED SOLUTION

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>

View solution in original post

9 REPLIES 9

Can you attach an image of the approval_variable_summary so I can see if there are any issues.

Hi @Kieran Anson 

 

Here is my code, i just copy pasted

 

<?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>

 

 

find_real_file.png

 

 

https://dev51896.service-now.com/nav_to.do?uri=%2Fsys_ui_macro.do%3Fsys_id%3Dff6287f80a25810300fdb97e7fb82ddf%26sysparm_domain%3Dnull%26sysparm_domain_scope%3Dnull

 

shaik

12345

 

@Kieran Anson 

can you please help me on this ?

 

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>

@Kieran Anson 

 

I think so it might be an issue with Orlando. 

 

So you just make changes to this UI Macro approval_variable_summary right ?

 

 

Correct