Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hacr
Creator
Creator

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
Creator
Creator
Author

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 );

View solution in original post

2 Replies
hacr
Creator
Creator
Author

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
Creator
Creator
Author

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 );