How to parse a dynamic choiceList defined in a Business Rule inside the UI Page
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:18 AM - edited 03-01-2024 06:03 AM
<body>
<j:set var="jvar_table" value="${sysparm_table}"/>
<j:set var="jvar_record_sys_id" value="${sysparm_sys_id}"/>
<j:set var="jvar_choice_list" value="${JSON.parse(sysparm_choices)}"/>
<g:evaluate>
var list = JSON.parse(RP.getParameterValue("sysparm_choices"));
var choiceList = new GlideChoiceList();
choiceList.add('', '--None--');
</g:evaluate>
<j:forEach var="jvar_item" items="${list}">
<g:evaluate jelly="true">
choiceList.add(jelly.jvar_item.value, jelly.jvar_item.displayValue);
</g:evaluate>
</j:forEach>
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:39 AM
I am able to save the UI page with the html you shared
could you please share screenshot where are you getting this error?
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:43 AM
After saving the UI Page, when I click to try it, this is what I can see there