Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
agigliotti
Partner - Champion
Partner - Champion

Data entry in Qlik Sense writing to database

Hello,

Our customer ask us to be able to do data entry ex. for budgeting inside a Qlik Sense app.

I looked at the branch but I did not find any extensions regarding this topic.

I'd like to prototyping a simple HTML table with two columns (ex. last year amount sold and current year budget) for all customers.

That is a simple HTML form with an input text for budget entry for each customer.

After the form is submitted the data should be written on database table (ex. MySql or others).

Could someone guide me to the right direction to achieve it ?

Many thanks in advance.

Best Regards

Andrea

25 Replies
Anonymous
Not applicable

Hi Andrea,

In the first instance it maybe worth reviewing SQL Writeback from QlikView extension object.

First I would put together a simple table extension, or take one from Qlik Branch. Would then embed a form/button calling an external PHP page with the values to write back.

Charlie

agigliotti
Partner - Champion
Partner - Champion
Author

thanks for your suggestion...

i'm working around developing an extension using angluarjs and making a jquery ajax call to nodejs with expressjs to write back form parameters to postgres database table.

Now I'm in troubles with the jquery ajax call because it seems to work only in GET method...even I specified type = POST

below my extension js code:

$.ajax({

  type: "GET",

  url: "http://localhost:3000/endpoint",

  data: jsonTxt,

  crossDomain: "true",

  contentType: "application/json; charset=utf-8",

  dataType: "jsonp",

  jsonpCallback: 'callback',

  cache: false,

  async: false,

  jsonp: 'jsonp',

    success: function( resp ) {

            alert('SUCCESS !!!');

            console.log( resp ); // server response

  },

    error: function() {

             console.log('Uh Oh!');

    }

      

});

working via GET request the url I get is like below:

http://localhost:3000/endpoint?jsonp=callback&{%22firstName%22:%20%22dvv%22,%22lastName%22:%20%22vcv...

and at server side using express js the parse function return an error parsing the request as below

var query = url.parse(req.url).query

JSON.parse(decodeURIComponent(query))

It would expect the following url:

http://localhost:3000/endpoint?{%22firstName%22:%20%22dvv%22,%22lastName%22:%20%22vcvccv%22}

What does it means "jsonp" and "_" parameters in query string ?

while forcing post method in jquery ajax (using $.post rather than $.ajax) the url called is like below:

http://localhost:4848/sense/[object%20Object]

I can't understand why !!!

In both way I have some problem.

Can anybody help me to fix it ?

Many thanks in advance.

Best Regards

Andrea

Clever_Anjos
Employee
Employee

What happens if you use $.post() instead of $.ajax()?

agigliotti
Partner - Champion
Partner - Champion
Author

as i wrote above I get the following url:

http://localhost:4848/sense/[object%20Object]

but I was expecting the same specified in the ajax call...!?

Clever_Anjos
Employee
Employee

It seems to be a Cross domain issue https://zinoui.com/blog/cross-domain-ajax-request

Please put

alert(window.location); at somewhere into your code

agigliotti
Partner - Champion
Partner - Champion
Author

I get as below:

WL.jpg

agigliotti
Partner - Champion
Partner - Champion
Author

I really don't understand why using type: "POST" it seems to be ignored... because it still uses GET method !!!

Clever_Anjos
Employee
Employee

As you pointing to same server but different ports (3000 x 4848) is considered a Cross Domain Post (Are different ports on the same server considered cross-domain? (Ajax-wise) - Stack Overflow)

When a Cross Domain Post occurs, it´s not possible to make a POST request using Ajax unless you configure to enable it

javascript - how to solve cross domain in ajax - Stack Overflow

javascript - What is the cross domain issue - Stack Overflow

Clever_Anjos
Employee
Employee

Please take a look at my last answer, that´s why your POST is being ignored