Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

hacr-sds
Contributor

Parse field selection back to URL?

Hi all

I was wondering if this is possible? I found this post dealing with URL-parameters and how to parse them ti Qlik API. Is it somehow possible to do it the opposite way? Setting a field and then update the URL?

Passing field selections in Qliksense Mashup through HTML URL

1 Solution

Accepted Solutions
hacr-sds
Contributor

Re: Parse field selection back to URL?

I think I managed to find a solution using the app.selectionState()

var selState = app.selectionState( );

var listener = function() {

    selState.OnData.unbind( listener );

var fieldSelections = selState.selections;

};

  selState.OnData.bind( listener );

2 Replies
hacr-sds
Contributor

Re: Parse field selection back to URL?

After some playing around I found the solution to parse it back into the URL by using the following:

var url = [location.protocol, '//', location.host, location.pathname].join('');

window.history.replaceState({}, url, "?" + "parameter=");

I would like the "parameter=" to be dynamic and read those information from the filter/fields using the API. Any suggestions or links how to Retreive the selected values of a filter?

hacr-sds
Contributor

Re: Parse field selection back to URL?

I think I managed to find a solution using the app.selectionState()

var selState = app.selectionState( );

var listener = function() {

    selState.OnData.unbind( listener );

var fieldSelections = selState.selections;

};

  selState.OnData.bind( listener );

Community Browser