Qlik Community

Qlik Sense Documents

Documents about Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER

Passing field selections in Qliksense Mashup through HTML URL

Specialist II
Specialist II

Passing field selections in Qliksense Mashup through HTML URL

Problem:

When we try to embed an app sheet or object in IFRAME using Single configurator, we are able to pass the selection to Fileds by appending this   "&select=<FieldName>,<FiledValue>" and the end of the generated URL. when we will be passing from our integrated host application. But when we try to do the same way in mashup we are unable to pass the selections like single configurator

Work Around:

So as work around solution we tried to parse the URL and take the parameters from URL and assign it to selections in the Mashup JS file.

Step1:

Add the below mentioned a function in Mashup JS file you can parse the string in your Mashup URL

function GetURLParameter(sParam)

{

    var sPageURL = window.location.search.substring(1);

    var sURLVariables = sPageURL.split('&');

    for (var i = 0; i < sURLVariables.length; i++)

    {

        var sParameterName = sURLVariables.split('=');

        if (sParameterName[0] == sParam)

        {

            return sParameterName[1];

        }

    }

}

Ref: Get URL Parameters using jQuery        |        jQuery By Example

Step 2:

Assign the parsed values to a variable using this function


var vFieldName= GetURLParameter('State');

Step 3:

Apply the variable to the Qlik selection

app.field("<FieldName>").selectMatch(vFieldName, false);

Sample Mashup URL Format : http://localhost:4848/extensions/mashup-test/mashup-test.html?<FieldName>=<FieldValue>

In case of multiple fields repeat the above step 2,3 again.

P.S. If there is any other better option to pass the selections to the Mashup URL, Please share.

Thanks,

Lakshmikandh

Comments
Contributor III
Contributor III

I added above function GetURLParameter,in my mashup.js file.

Where exactly we need to add the script foo calling GetURLParameter function

i.e. below code

var vFieldName= GetURLParameter('State');

if i add in mashup.js my dashboard data is missing and i cant see any data in the mashup objects

 

Do you have any working sample,kindly help

0 Likes
Contributor III
Contributor III

I added above function GetURLParameter,in my mashup.js file.

Where exactly we need to add the script for calling GetURLParameter function

i.e. below code

var name= GetURLParameter('State');

if i add in mashup.js my dashboard data is missing and i cannot see any data in the mashup objects

 

Do you have any working sample,kindly help

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2016-09-26 07:57 AM
Updated by: