Hi Anitha,
Check the
pcs.getPageContext().updateFilterContext function
This sets the filter on 2011:
pcs.getPageContext().updateFilterContext(
{
"sourceId": "model00000183c8404a03_00000002",
"itemId": "page_7.Year_",
"itemName": "Year",
"dataType": "integer",
"isHierarchy": false,
"isNamedSet": false,
"scope": "model00000183c83ff8df_00000002",
"eventSourceId": "NonNumericFilterController9"
}
, {
"command": "replace",
"values": {
"page_7.Year_->[2011]": {
"u": "page_7.Year_->[2011]",
"d": 2011,
"value": "page_7.Year_->[2011]",
"label": 2011,
"selected": true
}
},
"exclude": false
})
------------------------------
Paul Mendelson
------------------------------
Original Message:
Sent: Mon October 10, 2022 06:56 AM
From: Anitha Royal
Subject: RE : Running Dashboard using Javascript API (ca-dashboard-js-api) with Customised Extension
Hello Paul ,
Thank you for your response , with this class object we can just get the values of tab filters(saved values) but was looking to modify(edit) the Tab filter values using API same like Global Filters
------------------------------
Anitha Royal
Original Message:
Sent: Fri October 07, 2022 08:07 AM
From: Paul Mendelson
Subject: RE : Running Dashboard using Javascript API (ca-dashboard-js-api) with Customised Extension
The only place I've seen to access tab filters is through here:
var pcs = __getDashboardAPI().getFeature('PageContextService')
, items = pcs.getPageContext().getPageContextItems()
The items array has the tab filters. Use item[x].getScope() to match to a specific tab.
------------------------------
Paul Mendelson
Original Message:
Sent: Thu October 06, 2022 01:42 AM
From: Anitha Royal
Subject: RE : Running Dashboard using Javascript API (ca-dashboard-js-api) with Customised Extension
Hello All ,
We are trying to capture the Dashboard Filter values and Modify the values and run the dashboard using the Customized Extension .
As we have both Global Filters and This Tab Filters are available in a dashboard , we are able to read and modify the Global Filters values using available Dashboard Class objects (ca-dashboard-js-api). Here is the sample code .
var Gfilters = __getDashboardAPI().getFeature('GlobalFilters').getFilters();
Gfilters.editFilter({
itemId: ColumnId
}, {
values: [array]
});
Is there any class objects available to read and edit(modify programmatically) the "This Tab" Filter values using JavaScript Dashboard API ? If anybody has already using this feature please share the implementation details.
------------------------------
Anitha Royal
------------------------------
#CognosAnalyticswithWatson