GoodData Support - I am not able to use filterCont...
# gooddata-ui
j
GoodData Support - I am not able to use filterContextRef for Dashboard. Trying to pass dynamic filter to Dashboard. can someone please help me fix it? Please see error screenshot attached.
i
Hi John, I've noticed that you posted your message into multiple channels. This is not necessary. Our GoodData team is continuously checking all forums here and we try our best to reply to each inquiry in timely manner. I've gone ahead and deleted the duplicities, so we can track everything at one place. Also, please be so kind and post any related attachments under the same thread, if possible. Generally speaking, the property is only valid when you specify the
dashboard
prop by reference. May I know what version of SDK are you working with and what exactly do you mean by a dynamic filter, please? What behaviour would you like to achieve here?
j
@Ivana Gasparekova Thank you for quick respose. my SDK version is 10.17.0 how can I specify dashboard prop by reference here? I have embedded Dashboard in my app and I want to pass filter to Dashboard from my app.
image.png
is this how we specify dashboard prop by reference?
@Ivana Gasparekova also I don't see Set URL Parameter Filters option here. I have embedded dashboard to my app and want to pass filter from my app
i
Hi @John V, I am looping in our engineers to review your SDK related question, but I can help with the iFrames here. You can find the details about the filters and other available configuration in this article.
👍 1
r
Heya @John V, Radek from the GoodData Technical team here, let me have a look at the filter issue and I'll come back to you shortly! 🙂
Alright, I'm back! There are two ways to set filters from a parent app - the filterContextRef, and dispatch commands. The difficulty with the
filterContextRef
is that this needs a URI to a filter definition existing on the backend - as such, you would have to implement logic where the filters in your app are sent to our REST API to be created, and the resulting URI is then used as a reference to load the Dashboard. The other option, dispatch commands, are much more streamlined, and also used in our own filter loading in the UI through events/actions. Essentially, we listen to dashboard init and dispatch action to set the filter state to the desired filter. This sounds a little complex in theory, but we have a code example right here for you to get inspired by 🙂
🙌 1
👍 1
j
Thank you @Radek Novacek, I'll try to use dispatch command to set filter from my app to dashboard.
🤞 2
@Radek Novacek @Ivana Gasparekova in the dispatch command example link which you shared (here) has this uri in it (
Copy code
uris: ["/gdc/md/xms7ga4tf3g3nzucd8380o2bev8oeknp/obj/2196/elements?id=1"],
). how do I find that uri for my filter?
i
@Radek Novacek Could you please review John's last comment here and advise him on possible next steps?
👀 1
j
@Radek Novacek can you please help me on how do I find URI for my filter?
i
Hi @John V, I believe that in your case, the URI will be slightly different, since you are working with GD Cloud. Something similar to this:
/<workspace_name>/dashboard/<dashboard_name>
It can be retrieved from your browser, under the URL pointing to the affected dashboard.
j
@Radek Novacek @Ivana Gasparekova I have dashboard id & workspace id, but as per example (here) to dispatch command to filter, need to pass URI like this.
Copy code
uris: ["/gdc/md/xms7ga4tf3g3nzucd8380o2bev8oeknp/obj/2196/elements?id=1"],
what xms7ga4tf3g3nzucd8380o2bev8oeknp & 2196 represents in URI? I believe that id is related to filter. Please let me know how do I find that id for filter?
r
Hi John, the example uses GD Platform, so the URI still references a workspace ID (xms7ga4tf3g3nzucd8380o2bev8oeknp) and an object within the Platform (2196). For the Cloud, you'd be best off using our Catalog Export tool (here) and then setting the filter using those values (example here) - the documentation refers to the Attribute Filter component, but the filter format works the same way!
👍 1