Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lakshmikandh
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 help.

Thanks,

Lakshmikandh

0 Replies