- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2022 03:31 PM
The global search in the new experience only returns results of active records. The old global search would should show all results so you might get something like Change(0) because there are no active changes for the search term. The nice thing with the old search is you could click that link and remove active = true so you could see all changes related to the search term. This functionality is now gone so my users are asking for a way to search in this manner.
I have create a report which searches all of the task table and groups by task type. Then I have an interactive filter so they can choose which task types (INC, CHANGE, etc). I then wanted to create a keyword search to allow them to further filter the results. To do so I built a dynamic content block but I can't get it to work. My understanding is that if I can build an encoded query from a list view this should be possible. Here is the code for this simple content block. When dropped onto my dashboard I can't get the report to update results based on the keyword. This video presentation from SN indicates this is possible though it was not shown, just mentioned. https://www.youtube.com/watch?v=8eM6l4v75gw&t=746s
<?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("kw_search");
function searchForStrings (str){
var filter_message{};
filter_message.id = "kw_search";
filter_message.table = "task";
filter_message.filter = "123TEXTQUERY321=" + str;
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
},false);
my_dashboardMessageHandler.publishFilter(filter_message.table, filter_message.filter);
</script>
Kewyord<br/>
<input id="myCustomSearchString" type="text" value="" onChange="searchForStrings(this.value);" />
</j:jelly>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 01:52 PM
Hi Kim, I did get this to work and it's awesome. It has been so useful to be able to add this to dashboards. I attached the xml file below but here is the code as well.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<style>
</style>
<script>
var my_dashboardMessageHandler = new DashboardMessageHandler("FilterShortDescription");
function publishFilter (searchTerm) {
var filter_message = {};
filter_message.id = "FilterShortDescription";
filter_message.table = "task";
if (searchTerm == ""){
clearFilter();
}
else {
filter_message.filter = "123TEXTQUERY321=" + searchTerm;
//filter_message.filter = "short_descriptionSTARTSWITH"+ searchTerm;
}
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
my_dashboardMessageHandler.publishFilter(filter_message.table, filter_message.filter);
}
function clearFilter() {
var filter_message = {};
filter_message.id = "FilterShortDescription";
filter_message.table = "task";
filter_message.filter = "";
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
my_dashboardMessageHandler.removeFilter();
}
</script>
<input id="searchTerm" type="text" class="form-control" value="" onchange="publishFilter(this.value);"></input>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 01:45 PM
@Community Alums - did you ever get this to work? I'm trying to do the same thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 01:58 PM
@Kim Sullivan see below, sorry I forgot to tag you in my reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 01:52 PM
Hi Kim, I did get this to work and it's awesome. It has been so useful to be able to add this to dashboards. I attached the xml file below but here is the code as well.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<style>
</style>
<script>
var my_dashboardMessageHandler = new DashboardMessageHandler("FilterShortDescription");
function publishFilter (searchTerm) {
var filter_message = {};
filter_message.id = "FilterShortDescription";
filter_message.table = "task";
if (searchTerm == ""){
clearFilter();
}
else {
filter_message.filter = "123TEXTQUERY321=" + searchTerm;
//filter_message.filter = "short_descriptionSTARTSWITH"+ searchTerm;
}
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
my_dashboardMessageHandler.publishFilter(filter_message.table, filter_message.filter);
}
function clearFilter() {
var filter_message = {};
filter_message.id = "FilterShortDescription";
filter_message.table = "task";
filter_message.filter = "";
SNC.canvas.interactiveFilters.setDefaultValue({
id: filter_message.id,
filters: [filter_message]
}, false);
my_dashboardMessageHandler.removeFilter();
}
</script>
<input id="searchTerm" type="text" class="form-control" value="" onchange="publishFilter(this.value);"></input>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2023 04:30 PM
Hey Chris! This is great! Thanks for this code, i am using it for my Dashboards. In the last couple weeks, i was trying to replicate this code for 2 different tables, here is the scenario:
I have two lists, one list report containg incidents opened by my team, and the other one containg the kb articles sorted by view count from z to a. The two tables in question is "task" and "kb_knowledge". I tried to use
"filter_message.table = ["task", "kb_knowledge"];"
"filter_message.filter = "short_descriptionLIKE"+ searchTerm + "^ORkb_knowledge.short_descriptionLIKE" + searchTerm;"
but did not work. Do you have another solution for this?
Thanks in advance Chris!