- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 07:29 PM
I am trying to create an interactive filter using dynamic content blocks on the sys_user_group table to apply on a report based on a Database view that does an either or on a couple of group fields on the DB view. Unfortunately, the dropdown is not populating any values. Here is the code I have:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 09:54 PM
hi @Srini22 ,
i have made simple change on your above script and drop-down started showing up
<?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_groups" object="true" jelly="true">
var cl = new GlideChoiceList();
var gr = new GlideRecord('sys_user_group');
gr.addActiveQuery();
gr.query();
while (gr.next()) {
cl.add(gr.getValue('sys_id'), gr.getDisplayValue());
}
cl;
</g:evaluate>
<div id="groups_display">
<select id='group_select' class="form-control widget-content select2" onchange="filter_group()">
<option value="">Select a Group</option>
<g:options choiceList="${jvar_groups}"/>
</select>
</div>
<script>
var dbh = new DashboardMessageHandler("filter_group");
function filter_group() {
var group = $j('#group_select').val();
if (group) {
dbh.publishFilter('u_audit_history_catalog_task_assignment_group', 'oldgroup_nameLIKE' + group);
}
else
{
dbh.removeFilter();
}
}
</script>
</j:jelly>
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 09:54 PM
hi @Srini22 ,
i have made simple change on your above script and drop-down started showing up
<?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_groups" object="true" jelly="true">
var cl = new GlideChoiceList();
var gr = new GlideRecord('sys_user_group');
gr.addActiveQuery();
gr.query();
while (gr.next()) {
cl.add(gr.getValue('sys_id'), gr.getDisplayValue());
}
cl;
</g:evaluate>
<div id="groups_display">
<select id='group_select' class="form-control widget-content select2" onchange="filter_group()">
<option value="">Select a Group</option>
<g:options choiceList="${jvar_groups}"/>
</select>
</div>
<script>
var dbh = new DashboardMessageHandler("filter_group");
function filter_group() {
var group = $j('#group_select').val();
if (group) {
dbh.publishFilter('u_audit_history_catalog_task_assignment_group', 'oldgroup_nameLIKE' + group);
}
else
{
dbh.removeFilter();
}
}
</script>
</j:jelly>
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 10:54 PM
Thank you so much! I missed that! The dropdown works now and I am able to filter based on the sys_ids. However, the filter behavior seems to be inconsistent. Sometimes the report is filtering correctly, while other time it is not, even when the filter is set correctly. I am having to keep toggling the "Follow Interactive Filter on/off. Please see screenshots when it is working/not working correctly. Any ideas why this may be happening?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 10:55 PM
Here is the code I have:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 07:34 PM
Hi ,
Filter is displaying in dashboard, but there is no option to select act as a interactive filter. When i select one group in filter report is not following the interactive filter. Values not changing. I need modify anything in the code?