Hi all, can I use .change() method of kbnUrl service to navigate to a saved dashboard and pass a parameter to query on state enter?
I can navigate to the dashboard passing the url but can't figure out how paramObj works.
Thank you.
The paramObj is a key/value mapping used for string replacements in the url parameter. If you're trying to load a dashboard and set the query to a value, try this:
const url = '/dashboard/{{myId}}?_a=(query:(query_string:(query:{{myQuery}})))';
const paramObj = {
myId: '120d5d30-efdf-11e6-a9e8-417ea42ccca8',
myQuery: 'geo-dest=TEST'
};
kbnUrl.change(url, paramObj);
kibana urls store state as rison-encoded values in the url, including the search query.
Thank you BigFunger.
Now it works, but I'm searching something that it's not stricktly bound to the Url.
If I save a dashboard with some visualizations, than set the url variable to match with the one of my dashboard, and then I change my dashboard adding more vis I've to change the url to match again the new dash.
Is it right?
Thanks
I don't know what you mean by this.
AFAIK, the code I shared above should load the latest version that has been saved.
Sorry my fault, You are right!
It works like a charm.
Thank you so much!
You're welcome! Glad I could help
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.