- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 04:38 AM
Hi community,
I need help with Jelly. I have edited an com.glideapp.servicecatalog_category_view UI page, but I need to show my new element only for one specific category, if another - don't show it.
Need help with jelly syntax...
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 04:40 AM
Did you check this Jelly Tags - ServiceNow Wiki
<g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord("incident");
gr.addQuery("active", true);
gr.query();
gr;
</g:evaluate>
<j:if test="${!jvar_gr.hasNext()}">
We did not find any active incidents.
</j:if>
<j:if test="${jvar_gr.next()}">
We found ${jvar_gr.getRowCount()} active incidents.
</j:if>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 04:40 AM
Did you check this Jelly Tags - ServiceNow Wiki
<g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord("incident");
gr.addQuery("active", true);
gr.query();
gr;
</g:evaluate>
<j:if test="${!jvar_gr.hasNext()}">
We did not find any active incidents.
</j:if>
<j:if test="${jvar_gr.next()}">
We found ${jvar_gr.getRowCount()} active incidents.
</j:if>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 05:10 AM
Hi Raju Koyagura,
How can I use it to show my element only if user is opened a specific category? How to get current opened category?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 05:50 AM
HI Bogdan,
<j2:if test="gr.categery== ''provide value >
No records found<br />
</j2:if>
Thanks
Chandu Telu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 05:19 AM
You can add that in the query itself right
var gr = new GlideRecord("incident");
gr.addQuery("active", true);
gr.addQuery("category", "XXX");
gr.query();
gr;