Filter to be applied for different data source in UI builder of configurable workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 03:49 AM - edited 05-15-2024 03:51 AM
Hello All,
I have created three filter and multiple data visualization and used below client script to merge filter and working perfectly for all the data visualization if the data sources is same table.
We want to apply filter for different data sources and its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 09:44 AM
On the Filter component, config properties, there's a Data to filter property where you can add the table name and field for which the filter should apply. check the image below.
Mark it as correct if it resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:43 AM
Hello Sam
You are awesome. I was struggling for this long time and this helps alot.If its too much to ask.I could really use help once more in a new challenge.
I have dropdown for above widget as My work and My team's work.
I am using below script to populate data based on drop down selection but its working for CASE table but not working for this CASE SLA table(its a database view)
/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
* @Param {any} params.imports
*/
function handler({
api,
event,
helpers,
imports
}) {
api.setState('hideContainer', true);
var prevValue = api.state.prevFilterSelectValue;
const mywork = "assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe";
const myteamswork = "assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744";
const myworksla = "gcase_assigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe";
const myteamsworksla = "gcase_assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744";
const parFiltersmywork = [{
"apply_to": ["sn_customerservice_case", "sn_customerservice_case_sla_view"],
"order": 0,
"type": "query",
"encoded_query": mywork,myworksla
}];
const parFiltersmyteamswork = [{
"apply_to": ["sn_customerservice_case", "sn_customerservice_case_sla_view"],
"order": 0,
"type": "query",
"encoded_query": myteamswork,myteamsworksla
}];
var x = event.payload.value;
api.setState('parFilters', parFiltersmywork);
console.log("Event payload Value" + x);
if (x === 'mywork' && prevValue !== x) {
api.setState('hideContainer', true);
api.setState('prevFilterSelectValue', x);
api.setState('parFilters', parFiltersmywork);
var parFiltersmywork1 = JSON.stringify(parFiltersmywork);
console.log("parFiltersmywork1" + parFiltersmywork1);
}
if (x === 'myteamswork' && prevValue !== x) {
api.setState('hideContainer', false);
api.setState('prevFilterSelectValue', x);
api.setState('parFilters', parFiltersmyteamswork);
var parFiltersmyteamswork1 = JSON.stringify(parFiltersmyteamswork);
console.log("parFiltersmyteamswork1" + parFiltersmyteamswork1);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2025 12:50 AM
Hello,
What type of data source you created for Data Visualization to be applied via Filter?
I have the similar requirement: have a filter with instances and couple of Data Visualizations (Vertical Bar and Single Score) to show scan findings as per instance. Currently it is not dynamic. Could you please share with the type of source and code structure?
Thanks!