We have a use case where we need to be able to override a set of filters on a GoodData insight, we use the gooddata-sdk-ui-ext library.
We have a baked in filter at the GoodData level and we want to keep what is set in GoodData already but add on to it using a single in.
Right now, the way we have it set up, we use the InsightView React component and pass in a list of filters like so
<*InsightView* insight={insight.insight_id} filters={insight.filters} config={insight.config} />
Where insight.filters is a array of positiveAttributeFilters
What we need to be able to do is to essentially “override” the existing filters to pass in an filter
Current
curl --location --request POST 'https://<host>/api/actions/workspaces/<workspace>/execution/afm/execute' \
--header 'authority: <host> \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-US,en;q=0.9' \
--header 'authorization: Bearer <REDACTED TOKEN>' \
--header 'content-type: application/json' \
--data-raw '{
"resultSpec": {
"execution": {
"filters": [
{
"positiveAttributeFilter": {
"label": {
"identifier": {
"id": “CountryCode,
"type": "label"
}
},
"in": {
"values": [
“*BAKEDINFILTERVALUE*”
]
}
}
},
{
"positiveAttributeFilter": {
"label": {
"identifier": {
"id": "FinancialInstrument.TenantFinancialInstrumentId",
"type": "label"
}
},
"in": {
"values": [
“*VALUE WE ARE TRYING TO ADD TO IN ABOVE*”
]
}
}
},
],
"auxMeasures": []
},
"settings": {}
}'
Desired
curl --location --request POST 'https://<host>/api/actions/workspaces/<workspace>/execution/afm/execute' \
--header 'authority: <host> \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-US,en;q=0.9' \
--header 'authorization: Bearer <REDACTED TOKEN>' \
--header 'content-type: application/json' \
--data-raw '{
"resultSpec": {
"execution": {
"filters": [
{
"positiveAttributeFilter": {
"label": {
"identifier": {
"id": “CountryCode,
"type": "label"
}
},
"in": {
"values": [
“*BAKEDINFILTERVALUE*”, “*VALUE WE ARE TRYING TO ADD*”
]
}
}
},
],
"auxMeasures": []
},
"settings": {}
}'
Does the gooddata-sdk-ui-ext library provide a way to accomplish what we need ?