Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use App Integration API when fields have spaces

I'm using QlikSense 3.2 and trying to implement app chaining by building dynamic URLs using the App Integration API. My goal is to be able to pass current selection criteria from a "master" app to a "detail" app. I'm using the Sense Navigation + Actions extension and the Emulating document chaining in Qlik Sense paper to model my solution.

I have this solution working except for when the Field whose selections I'm trying to pass has spaces in its name (e.g. Field 1 vs Field1). I build the URL in a sheet expression.

This URL works:

https://<ServerName>/sense/app/<AppID>/sheet/<SheetID>/state/analysis/select/Field1/Value1;Value 2;Value3/

but this one does not:

https://<ServerName>/sense/app/<AppID>/sheet/<SheetID>/state/analysis/select/[Field 1]/Value1;Value 2;Value3/


I tried removing the square brackets ("[ ]") from the not-working URL, but then my sheet expression would not return a value.


My field's selected values (Value1, Value 2, and Value3) are all text values, not numbers presented as text.  For example, they're global regions like China, Japan, Mid East - Africa, etc.


Any ideas on how to make this work when the field name has spaces in it?

3 Replies
Anonymous
Not applicable
Author

I was able to solve this myself. To build my selected values segments I was using variable with this expression for each filter field

vFieldSelections

If(GetSelectedCount($1)=0,Null(),'select/' & '$1/' & Concat(distinct $1,';') & '/')

When a field had spaces in its name, I had to enclose it in brackets when passing it into the variable or else the variable would not resolve:

$(vFieldSelections([Field 1])

But in doing so, the string "[Field 1]" would be placed in the app integration URL, which is apparently, bad syntax.

I changed the variable's formula to this, and everything started working:

If(Len(GetCurrentSelections()) = 0, Null(), 'select/' & GetCurrentSelections('/select/', '/', ';') & '/')

GetCurrentSelections returns a string of all current selections in a format where you can find various delimiters. Check it out in the help file. It bypasses the issue I was having with using the square brackets to get selections for field names like "Field 1". Also, it simplifies your implementation, because you only have to reference the variable once for the entire URL rather than one time for each field that may have selections.

Aiham_Azmeh
Employee
Employee

Hi bbainsslalom‌,

It should just work, try to URL encode by replacing the space with `%20`.

Is it browser specific?

neha_sharma1275
Contributor II
Contributor II

Did you get an answer for your query ? I have the exact same issue and not able to resolve that.