Interactive Filters not working on variable values.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 05:49 AM
Content Block code -
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide">
<!-- Evaluate and fetch choices for the variable -->
<g:evaluate var="jvar_status" object="true" jelly="true">
var statusArray = [];
// Replace with your variable's sys_id
var gr = new GlideRecord('question_choice');
gr.addEncodedQuery('question=e1135065b9766610c629de285ff18192');
gr.addOrderBy('name');
gr.query();
while (gr.next()) {
statusArray.push([gr.getValue('value'), gr.getValue('text')]);
}
statusArray;
</g:evaluate>
<!-- Dropdown for filtering statuses -->
<select id="filter_statuses" class="select2-search" onchange="filterStatus()">
<option value="">All</option>
<j:forEach var="jvar_state" items="${jvar_status}">
<option value="${jvar_state[0]}">${jvar_state[1]}</option>
</j:forEach>
</select>
<!-- Script to handle filtering -->
<script>
var dbh = new DashboardMessageHandler("filter_status");
function filterStatus() {
var status = $j('#filter_statuses').val();
if (status) {
// Replace with actual sys_ids for catalog item and variable
dbh.publishFilter(
'sc_req_item',
'cat_item=3ee0d861b9366610c629de285ff1812d^variables.e1135065b9766610c629de285ff18192=' + status
);
} else {
dbh.removeFilter();
}
}
// Apply filter on load
filterStatus();
</script>
</j:jelly>
The above screenshot shows that the dropdown values are coming as expected, but it is not reflecting in the dashboard.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2025 11:03 PM
Hi @Prithvi Ramesh1 ,
can you please check below widget configuration over the report widget title bar and select the settings cog to open the widget configuration. Select checkbox "Follow interactive filters" & "Show when following interactive filters".
for reference : Custom Interactive filter based on Catalog item variables
Thanks,
BK