Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
shalini
Contributor III
Contributor III

Make a call to external API on click of a button which returns some data to be displayed on qlik

Hi Experts,

I have button widget added on qlik dashboard and what i want to achieve is on click of the  button it makes a call to an external API and fetch some data/chart from there and returns it on the qlik dashboard .

Wanted to know your opinion if this is feasible . We are trying to reduce the workload of creating a separate mashup . Since we have an app built externally , we were looking for options if it is feasible to access the data from that app and return it on qlik dashboard based on user request.

Whether we can add the js code for ajax call through a custom component in qlik.

Thanks

Labels (2)
10 Replies
NitinK7
Specialist
Specialist

you need to create your own extension for the button

shalini
Contributor III
Contributor III
Author

HI Nitin , 

Thanks for the response . I did try adding a button as an extension and then on click of it , it makes an ajax call to my web API  to fetch some data.

But when dragging and dropping it to on the dashboard, it's giving blank response. The same code tested on mashup editor is returning the appropriate response.

Do we have any sample code for the button extension making an ajax call, would be really helpful.

Or is there any dependency that we need to check for extensions , since my code is working fine in mashup editor .

Thanks 

ErikWetterberg

Have you checked the browser console for  errors?

shalini
Contributor III
Contributor III
Author

hey , 

Yeah i did . As mentioned earlier it's working fine in mashup editor . But for extensions it's giving no response.

NitinK7
Specialist
Specialist

Please try once open hub in browser and check same 

using below url to open hub in your browser

http://localhost:4848/hub/my/work

first need to open qliksense otherwise this url not work in browser

shalini
Contributor III
Contributor III
Author

HI Nitin , 

Sorry , didn't get you . So you are just referring to the dev hub right ?

I am accessing all the extensions built there only .

Thanks

NitinK7
Specialist
Specialist

No, I am not talking about dev hub

see below screenshot

1- qliksense App

2. same is open in browser

so you need to try your ext button in browser instead of qliksense app

Capture.PNG

shalini
Contributor III
Contributor III
Author

Thanks.

Tried it still it's giving invalid visualization.

Not sure if there are any other dependencies that needs to be added here or any particular format that needs to be followed since in my code i just have created a sample html file containing the button and onclick function.

Since i am completely new to this any sample code/example will be helpful . 

Thanks

 

 

NitinK7
Specialist
Specialist

can you attache your button code here?