Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to retrieve data from custom table and display the data in the UI page

chandana14
Kilo Contributor

As i am a beginner in jelly scripting. I am facing issue to retrieve data from the custom table and to display that data in UI page. Can anyone help me with the script?

1 ACCEPTED SOLUTION

Hi Chandan,

You can do it in two ways:

in UI action you have to use setPreference and add the 

the variable we have used is (no_of_cases)  you can pass any value from the form to it as of now i have passed static 55 from ui action to ui page

var contactUIMacro = new GlideModal('sn_customerservice_Actives Cases with Same Contact', false, 'modal-lg');
	contactUIMacro.setTitle('Active cases with same contact');
	var noOfCases = '5';
	contactUIMacro.setPreference('no_of_cases', '55');  //The new variable which you need to pass to UI page
	contactUIMacro.render();

 

UI page:

you have to use the expression at the top and that variable you can use in the div tag.

<?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 var="jvar_num_case"
    expression="RP.getWindowProperties().get('no_of_cases')" />

	

	<div class="form-group">
		<p>There are currently ${jvar_num_case} active cases with the same contact.</p>
	</div>

</j:jelly>

 

 

 

Mark helpful and correct if it helps.

Thanks,

CB

View solution in original post

5 REPLIES 5

Hello Ankur 

 

Can we display metric instance-assignment group definition through this same script ,what changes are required in script ?