Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jlaumelb
Contributor
Contributor

React Mashup - getAppList()

Hi All,

I am starting to play around with React to create a Qlik Sense mashup and am encountering issues when trying to retrieve an app listing on the Qlik Sense Server.   Below is the following code where I encounter an error in the second .then with an error of Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'then').

The first console.log(app) appears to be working in the console and I have attached a screenshot for reference.  

Any help would be much appreciated!

 

const app = qApp(testConfig, qlikTicket);
//console.log(app);

app.then(app => {
console.log(app);
app.getAppList().then(data=> {
setTest(data);
})
})

  

jlaumelb_0-1636696290908.png

 

1 Reply
Aiham_Azmeh
Employee
Employee

Hi @jlaumelb ,

 

Our client APIs, are sometimes inconsistent the `getAppList` method has a callback method, see example here

You should probably do instead:

const app = qApp(testConfig, qlikTicket);
//console.log(app);

app.then(app => {
  console.log(app);
  app.getAppList(data=> {
    setTest(data);
  })
})


I hope this helps,