Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
@srilakshmi_as , I am also having the same requirement, please help how did you resolve this.