Hi, I am working on Gooddata cloud custom project ...
# gooddata-ui
v
Hi, I am working on Gooddata cloud custom project [12:17 AM] and created react app with gooddata sdk, I am able to render data in InsightView component but while working with AttributeFilter, I have set default filter to render data by default in InsightView Component which is not working. i followed the documentation and copied exact code to make it work here is the link https://gdui-examples.herokuapp.com/attribute-filter-components/attribute-filter but when i filter data from attributefilter its not filtered data inside InsightView, Can someone help on this? I am sharing complete code snippet here. // (C) 2019-2023 GoodData Corporation import React, {useState} from "react"; import { BackendProvider, WorkspaceProvider } from "@gooddata/sdk-ui"; import { InsightView } from "@gooddata/sdk-ui-ext"; import { Dashboard } from "@gooddata/sdk-ui-dashboard"; import { backend } from "./backend.js"; import * as Md from "./catalog.js"; import img from "./assets/gooddata-logo.svg"; import { newMeasureValueFilter, newPositiveAttributeFilter, modifyMeasure } from "@gooddata/sdk-model"; import { AttributeFilter } from "@gooddata/sdk-ui-filters"; import { idRef, newNegativeAttributeFilter, uriRef } from "@gooddata/sdk-model"; export const App = () => { const [filter1, setFilter] = useState( newPositiveAttributeFilter("rep_purchase_orders_vw.client_name", ["Acadia Pharmaceuticals - SV1", "Brahma Group"]), ); return ( <BackendProvider backend={backend}> <WorkspaceProvider workspace={workspaceId}> <div className="app"> <AttributeFilter filter={filter1} onApply={(filter, _isInverted) => { console.log(filter); setFilter(filter); }} /> <figure> <InsightView filters={filter1} insight={Md.Insights.PurchaseOrders} showTitle workspace={workspaceId}/> </figure> </div> </WorkspaceProvider> </BackendProvider> ); }; Also i am sharing console error i got!
j
Hi Vikas, I have a suspicion that the issue could be in the referenced attribute
rep_purchase_orders_vw.client_name
in the attribute filter. Can you doublecheck if it is it is the correct reference and would you mind checking if the same insight and the same filter working correctly in your GoodData Cloud environment?
v
same attribute is working with gooddata cloud
j