Array value check in jelly script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 05:15 AM
In my UI Page,I have called the Script Include which return the Array object.
How to check the Array has value or not in jelly script
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 01:08 AM
Hi @Ketan Pandey
You can use the below
<j:if test="${myArray != null && myArray.length > 0}">
<!-- Code to execute if the array has values -->
<p>Array has values!</p>
</j:if>
<j:if test="${myArray == null || myArray.length == 0}">
<!-- Code to execute if the array is empty or null -->
<p>Array is empty!</p>
</j:if>
please mark as accepted & helpful
Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 01:41 AM
Please share your script here
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader