Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use Backend API from Mashups?

In Qlik Sense Backend API reference written:

Available for extensions as this.backendApi.

Is it possible to call Backend API methods when I develop mashups?


Or how else to load more then 10000 cells of qHyperCube? It is possible using this.backendApi.getData method in QlikSense extension, but how to do this from mashup?

Thanks for any advice.

1 Solution

Accepted Solutions
11 Replies
Stefan_Walther
Employee
Employee

Hi,

first of all here are two examples how to fetch more than 10.000 data-points in Qlik Sense Visualization Extensions:

qsExtensionPlayground on GitHub > HyperCubePaging

Simple table (extension example)

But, I have just realized that you were asking for Mashups ... so let me create another example ... stay tuned ... 😉

Regards

Stefan

nstefaniuk
Creator III
Creator III

Hello,

I have a similar issue : I try to apply a filter on data model from a mashup but I get an error message :

Uncaught TypeError: Cannot read property 'selectValues' of undefined

when I try

this.backendApi.selectValues(...

It works well in an extension but not in Mashup.

I guess I have missed something very tricky like, for example, a Mashup is not a layer over a QlikSense application, so you can't send backend API commands to a QlikSense application from a mashup.

Or maybe it's because call to backendApi should be done in

function AppUi ( app ) {

and not in the callbacks defined on an HyperCube.

Thanks for you help !

ErikWetterberg

Hi,

No, you cannot use the backendApi in a mashup, since the backendApi is actually a part of the visualization.

The easiest way to make selections in a mashup is to use the field API. The select method is the one the corresponds to the selectValues method in an extension:

app.field('LastName').select([0, 1, 2], true, true);

Like the selectValues method it is based on using the numbers QIX engine sets on all values when you load your data (the array [1,2,3] in the example. You find those values in the field qElemNumber in the HyperCube data.

Other options include the selectMatch and toggleSelect methods where you do not need to have the qElemNumber but can use a string match.

app.field('LastName').selectMatch('A', true);

There is also the field.selectValues method, where you can make a selection on exact string or numeric values:

app.field('LastName').selectValues([{qText: "Andersson"},{qText:"Bush"},{qText:"Obama"}], true, true);

or a simplified syntax:

app.field('LastName').selectValues(["Andersson","Bush","Obama"], true, true);

Hope this helps

Erik

nstefaniuk
Creator III
Creator III

Great!

I will test tonight.

It sure helps !

Have you some explanations about why the backendapi is restricted to visualization ? I don't really understand why this APi is available in extension and not in a Mashup. Is it because a Mashup can access more than 1 application ? Maybe there is a document that explain it well?

Thanks a lot

stevenkoppens
Partner - Contributor III
Partner - Contributor III

Hi Guys,

Any ideas yet how to access more than 10.000 datapoints from a mashup/hypercube? I'm running into the limit to, because of some calculations I have to perform within my tables (to get some averages etc).

Kr, Steven

Not applicable
Author

Likewise, anyway to achieve this?

I looked at GitHub - skokenes/senseUtils: a JavaScript library for developing Qlik Sense web solutions with the ...‌ but looks like there are some memory leak issues so don't want to go that route

Yianni_Ververis
Employee
Employee

Hello,

I have blogged about getting all data with the Capabilities API

https://community.qlik.com/blogs/qlikviewdesignblog/2016/10/14/getting-all-data-cells-from-appcreate...

Not applicable
Author

‌Which version of qlik sense are you using?

The getHyperCubeData is not valid in the context of the object returned from app.createCube

I also tried getting the model from app.getObject, that too does not have the getHyperCubeData method in the context.

Do you a working sample anywhere?

Yianni_Ververis
Employee
Employee

Hello Patreek,

I am using 3.1.

42a at the Downloads page has over 3M cells. It will take a few minutes because I am pointing to a non production server

UN Gender Statistics