Creating a Custom multi-choice Interactive Filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 06:06 PM
Hello,
We have a dashboard for a particular Business Unit with multiple reports of Business Applications for that particular BU.
This is what the filters look like:
The Primary Portfolio is a reference field that is sourced off the "Portfolios" table, while the Other Portfolios is a List collector field that can have multiple Portfolios.
We now have the requirement to make this dashboard work for all BUs by adding an Interactive filter (multi-choice) with which they can select their BU/s and see the dynamic reports. It would have been easy requiring a single multi-choice Interactive filter for "Portfolios" but it can only work with Primary Portfolio at a time. It doesn't work with Other Portfolios simultaneously and doesn't have the mapping option to that field either.
Is there a way to create a custom Interactive filter (using Dynamic Content block) with multi select dropdown that works with the reports adding both the conditions at the same time?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 06:12 PM
Have a read through this: Reporting on Lists – Part 3/3 on Conquer Challenging Reports by Leveraging the Now Platform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 06:22 PM
Thanks, Adam. Is there any other way apart from the custom table route? With the help of your K19 video, I was able to create a custom widget that works with the name of the Application.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
var my_dashboardMessageHandler = new DashboardMessageHandler("businessapplookupbyname");
function searchForStrings (str) {
var filter_message = {};
filter_message.id = "businessapplookupbyname";
filter_message.table = "cmdb_ci_business_app";
<!-- Add your own filter query logic here -->
filter_message.filter = "nameLIKE" + str;
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
my_dashboardMessageHandler.publishFilter(filter_message.table, filter_message.filter);
}
</script>
<br/>
<!--<input id="myCustomSearchString" type="text" value="" onChange="searchForStrings(this.value);" />-->
<div class="form-group row" style = "margin-left:0px;margin-right:0px">
<div class="col-md-8 col-md-offset-2">
<input id="myCustomSearchString" placeholder="Search Business Applications" type="text" value="" onChange="searchForStrings(this.value);" class="form-control" />
</div>
</div>
</j:jelly>
I was hoping to create something similar but wasn't able to find a way to add a choice dropdown.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 08:14 PM
You have to loop through the selected values and add an ORnameLIKE. The list is a csv, so is you multiselect. With a single value, LIKE works, but not with a multiple as you would have to match the order too.
Split "str" on , then loop through those in a single pass. This can get weird depending on your other filters as you need to make sure you use ^NQ and ^EQ correctly. I would be a query string on the table manually with on the list to see what it looks like when you do multiple selected likes on a list view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2020 08:18 PM
Thanks a lot. I'll give this a try.