Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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:
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
What happens if you use $.post() instead of $.ajax()?
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...!?
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
I get as below:
I really don't understand why using type: "POST" it seems to be ignored... because it still uses GET method !!!
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
Please take a look at my last answer, that´s why your POST is being ignored