Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Lee_Matthews
Former Employee
Former Employee

How to access system objects inside extension object script?

I am creating an extension object to display some text in a scrollable box in QlikView - just like an HTML textarea element. The text in the box will be populated from an external source, and the user will be able to edit the text and click a button to save it back to the source. To start with I am trying to get the text from (and store it) in an xml document or even just a text file. But I am finding that when I try to instantiate a filesystem object or xmldom object in the script it does not work. I assume a DB connection object would be the same.

Should the extension object javascript be able to reference system objects such as ActiveX, ADO and FileSystem?

I have set the module security to allow System Access, but does that also relate to extension objects or is there some other configuration I have missed?

Message was edited by: Lee Matthews

13 Replies
Brian_Munz
Employee
Employee

I'm not sure how helpful it's going to be to simply look at the extension itself.  It was built quickly and the code is probably not as tight and easy to navigate as it should be since it ended up being touched by a lot of different people.  The basic idea is that you first send a POST AJAX call to the BigQuery API which queries the data set.  In this demos case it's something like this:

SELECT mother_race, mother_married, COUNT(*) as count FROM [publicdata:samples.natality] WHERE   (mother_race in (0, 1, 2, 3, 4, 5, 6, 7, 9, 18, 28, 38, 48, 58, 68, 78)) GROUP BY mother_race, mother_married ORDER BY mother_race;

These numbers and what they mean and why we had to use them gets extremely convoluted and isn't really important, but it was the nature of the data.  But in general, this is a pretty standard syntax for querying data.  Then, the code waits about a second or so while BigQuery gets the results, then sends a GET AJAX call to retrieve the results.  The data comes back in JSON notation, and the extension then parses through all of the code.

So the part that shows the bar chart is not as important to the demo since it's just using a 3rd parting JS visualization library to display the data.  You could use anything you want to display the data in the extension.  The important piece is that it's going out to BigQuery and retrieving results based on a huge data set and bringing it into the extension.  Beyond that it's just like creating any other extension.

Not applicable

That worked for getting the myfunction.js file... Thanks...

Michael_Reese
Employee
Employee

A downloadable example would be excellent.

Not applicable

HI all,

Can any tell me how to access the chart in the current document from the extension script.

Thanks,

Sampath